| ||||||||||
| 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 | |||||||||
疯了/*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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator