模拟就行
#include <bits/stdc++.h>
using namespace std ;
const int N = 1e5 + 5 ;
int n ;
int main ( ) {
while ( cin >> n ) {
int n2 = n * n ;
int res = 0 ;
while ( n > 0 ) {
res += n % 10 ;
n /= 10 ;
}
int ers = 0 ;
while ( n2 > 0 ) {
ers += n2 % 10 ;
n2 /= 10 ;
}
cout << res << ' ' << ers << endl ;
}
return 0 ;
}