数字之和
数字之和
http://www.nowcoder.com/questionTerminal/ae759916631f4711a90c4d4d9657f4b0
#include <stdio.h> int main(){ int n,t,a,b; while(scanf("%d",&n)!=EOF){ t=n*n; a=0;b=0; while(n!=0) { a+=n%10; n/=10; } while(t!=0) { b+=t%10; t/=10; } printf("%d %d\n",a,b); } }(•̀ᴗ•́)و