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 |
测试都过,但OJ总是WA#include<stdio.h> int main(void) { int i = 0; float length[100]; for(i = 0;;i++){ scanf("%f",&length[i]); if(length[i] == 0.00) break; } for(i = 0;length[i] != 0.00;i++){ float sum = 0; float divisor = 2; if(length[i] < 0.01 || length[i] >=5.20){ break; } else { for(;sum <= length[i];divisor++) sum += (float)1 / divisor; printf("%0.f card%c\n",divisor - 2,(divisor - 2 > 1)?'s':' '); } } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator