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 |
...#include <stdio.h> int main () { int i; int counter; float sum; float c; scanf("%f", &c); while(c != 0.00 && c >= 0.01 && c <= 5.20) { counter = sum = 0; for(i = 2; sum < c; i++) { sum += 1.00/i; counter++; } printf("%d card(s)\n", counter); scanf("%f", &c); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator