Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
错在哪里????#include<stdio.h> void main() { long a,b,n,i,c,k,e,j,l,sc,sb,sk,sn,fg[90000]; scanf("%l6d",&a); for(j=0;;) { n=0;k=1;b=a/10; for(i=0;i<4;i++) { c=b%10;n+=c*k;b=b/10;k=k*10; } if(n>1000) e=4; else { if(n>100) e=3; else { if(n>10) e=2; else e=1; } } sb=0;sb+=n*n;sk=1;sn=0; for(i=0;i<6;i++) { sc=sb%10;sn+=sc*sk;sb=sb/10;sk=sk*10; } fg[j]=sn; for(l=0;l<j;l++) { if(fg[l]==sn) { printf("%ld %d %d\n",sn,e,j+1); break; } } if(l<j) break; else { a=sn;j++; } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator