文章
145
粉丝
217
获赞
21
访问
84.5k
#include <stdio.h> int main() { long long n,t; while(scanf("%lld",&n) != EOF) { t = n; int sum1 = 0,sum2 = 0; while(t) { sum1 += t%10; t/=10; } t = n*n; while(t) { sum2 += t%10; t/=10; } printf("%d %d\n",sum1,sum2); } return 0; }
登录后发布评论
暂无评论,来抢沙发