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> #include<math.h> int main() { float m; float n = 0; int i; while(1) { scanf("%f",&m); if (m == 0.00) return 0; else { for(i=2;n<m;i++) { n += 1.0/i; } n = 0; } printf("%d\n",i-2); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator