| ||||||||||
| 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 | |||||||||
样本测试数据都是对的,但总是wrong answer.请指点一下。。。不胜感激!#include<stdio.h>
void main()
{
float s=0;
float a[20];
int n,i=0;
printf("input the positive floating-pointing number C:\n");
scanf("%fn",&a[i]);
while(a[i]!=0&&i<19)
{
printf("\n");
i++;
scanf("%f",&a[i]);
}
for(i=0;a[i]!=0;i++)
{
for(s=0,n=1;s<a[i];n++)
s+=1.0/(n+1);
printf("%d card(s)\n",n-1);
}
getch();
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator