Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

为什么 小于3就不行了 !

Posted by 261492549 at 2010-03-18 20:06:33 on Problem 2407
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator