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 |
Re:改了一下In Reply To:改了一下 Posted by:00448264 at 2005-10-15 22:17:06 > #include <stdio.h> > void main() > { > long input,i,save; > scanf("%ld",&input); > while(input!=0){ > if(input==1)printf("0\n"); > else { > save=input; > if(input%2==0)save/=2; > while(input%2==0)input/=2; > for(i=3;input!=1;i=i+2){ > if(input%i==0)save=save*(i-1)/i;==>save=save/i*(i-1);或则save-=save/i; > while(input%i==0)input/=i; > } > printf("%ld\n",save); > } > scanf("%ld",&input); > } > } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator