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 |
为什么 小于3就不行了 !#include <stdio.h> #include <stdlib.h> int main() { int n,i; while(scanf("%d",&n)&&n!=0){ for( i=2;i*i<=n;i++) { int p=1; if(n%i==0) { n=n/i; p=p*i-1; while(n%i==0) { n=n/i; p=p*i;} } if(n>1) p=p*n-1; printf("%d",p); }} return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator