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

疯了

Posted by baichen at 2006-07-22 16:10:20
/*about the rich ancle*/
#include<stdio.h>
main()
{int i,j;
 float sum=0;
 float d[18];
 int c[18];
 int n;
 int x=2;/*用来恢复j的值*/


 /*printf("Please input the number of your realatives:");*/
 scanf("%d",&n);


 for(j=2;j<18;j=x)
   {for(i=0;i<n;i++)
      {c[i]=j;
       j+=1;
      }
      for(i=0;i<n;i++)
        {d[i]=1./c[i];
         sum+=d[i];
         }
      if(sum<1)
         break;
       else
        sum=0;
        x+=1;
     }

   for(i=0;i<n;i++)
       {
        printf("%d\n",c[i]);
       }

}

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