Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
5424 D班-罗炜翰 分离整数的各个数 C++ 解答错误 0 1 MS 260 KB 593 2025-02-09 14:59:03

Tests(0/5):


/*#include<bits/stdc++.h> using namespace std; int main() { int a,b,d,e,f; while(cin>>a>>b>>e>>f) { a = a + b; e = e + f; if (a > 0) { a = 0; } else if (a > 0 && b > 0) { a = 0; e = 0; } else if (e > 0) { e = 0; } if (a > e) { cout<<"1"<<endl; } else if (a == e) { cout<<"0"<<endl; } else if (a < e) { cout<<"-1"<<endl; } } }*/ #include<bits/stdc++.h> using namespace std; int main() { int a = 0,b; cin>>b; do { a += b % 10; a += ' '; b /= 10; }while(b); cout<<a; }


测评信息: