Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
160587 Kevin 数字之和 C++ Accepted 1 MS 284 KB 283 2026-09-24 15:07:49

Tests(1/1):


Code:

#include<bits/stdc++.h> using namespace std; int wsh(int n){ int z=n; int s=0; while(z!=0){ s+=z%10; z/=10; } return s; } int main() { int a; cin>>a; while(a!=0) { cout<<wsh(a)<<" "<<wsh(a*a)<<endl; cin>>a; } return 0; }