为什么是60 分啊 求指教!

P1035 [NOIP2002 普及组] 级数求和

AnthonyW @ 2018-11-18 20:00:57

include<stdio.h>

include<math.h>

int main(void) { float k,n,sum=0.0; scanf("%f",&k); for(n=1;n;n++) { sum=sum+1.0/n; if(sum>k) break; } printf("%.0f",n); return 0; }


by maorui_cow @ 2018-11-18 20:09:10

double


by maorui_cow @ 2018-11-18 20:09:19

hhh


by AnthonyW @ 2018-11-18 20:11:35

嗯嗯 我刚刚也想到改double了嘻嘻谢谢


|