标签:blog io os for div sp log c amp
模拟题
#include <iostream> #include <cstdio> #include <algorithm> using namespace std; int p[1000000]; int main(){ int n; while(scanf("%d",&n)!=EOF){ memset(p,0,sizeof(p)); int i; for(i=1;;i++){ n/=10; n%=10000; n*=n; n%=1000000; if(p[n]>0){ break; } p[n]=i; } printf("%d %d %d\n",n,i-p[n],i); } return 0; }
标签:blog io os for div sp log c amp
原文地址:http://www.cnblogs.com/jie-dcai/p/3971801.html