丸子君学编程 @ 2018-08-15 13:03:12
#include <cstdio>
using namespace std;
int main()
{
double n=1,k;
scanf("%lf",&k);
while(n<=k)
n+=1/(n++);
printf("%0.0lf",n-1);
return 0;
}
洛谷说编译错误,还不是wa掉,我问我身边的人他们都不知道,求解啊!!
by mimajiushizhangha @ 2018-08-15 13:03:43
辣鸡
by ShineEternal @ 2018-08-15 13:04:20
蒟蒻还真不知道0.0是啥。。。
by ShineEternal @ 2018-08-15 13:04:56
@mimajiushizhangha 我建议还是不要这样诋毁新人
by Altria_Pendragon_ @ 2018-08-15 13:06:25
@丸子君学编程 n++错了
by Altria_Pendragon_ @ 2018-08-15 13:07:24
@丸子君学编程 啊不请忽略上面的回答
by little_gift @ 2018-08-15 13:07:58
不会选错语言了吧
by little_gift @ 2018-08-15 13:08:23
@丸子君学编程 您怕不是选了C语言
by mimajiushizhangha @ 2018-08-15 13:11:09
by _Int_ @ 2018-08-15 13:14:44
@mimajiushizhangha emming
by lemir3 @ 2018-08-15 13:16:45
语言选错啦,我看你选的是C