#include<iostream>
using namespace std;
int main()
{
int n,num,m;
int a,b;
cin>>num;
while(num--){
cin>>n;
if(0==n)
{
break;
}
else {m=n*n;
a=b=0;
while(n!=0){
a+=n%10;
n/=10;
}
while(m!=0){
b+=m%10;
m/=10;
}
cout<<a<<" "<<b<<endl;
}}
system ("pause");
return 0;
}
数字之和-2011吉大机试
最新推荐文章于 2023-07-24 17:16:08 发布