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> #include<math.h> int eula(int N) { if(N==2)return 1; if(N==3)return 2; int sq=sqrt(N),E=N; for(int j=2;j<=sq;++j) { if(N%j==0) { E=E*(j-1)/j; while(N%j==0)N=N/j; } } if(N!=1)E=E*(N-1)/N; return E; } int main() { int N; __int64 sum=0; while(scanf("%d",&N)+1) { if(N==1)sum=1;if(N==2)sum=3;if(N==3)sum=5; if(sum){printf("%I64d\n",sum);sum=0;continue;} sum=N; int sq=sqrt(N); for(int i=2;i<=sq;++i) { if(N%i==0) { int r=N/i; sum=sum+eula(i)*r; if(i!=r)sum=sum+eula(r)*i; } } sum=sum+eula(N); printf("%I64d\n",sum); sum=0; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator