wyx123456789 @ 2019-10-16 14:03:07
int main()
{
int K,i;
double S=0.0;
scanf("%d",&K);
for(i=1;S<K;i++)
S=S+1/i;
printf("%d",i);
return 0;
}
by Pisces @ 2019-10-16 14:15:52
希望更丰富的展现?使用Markdown
by Pisces @ 2019-10-16 14:16:36
S=S+1.0/i
吧
by wyx123456789 @ 2019-10-16 19:05:07
@Pisces 不是,没有用
by Pisces @ 2019-10-16 19:12:40
@wyx123456789 为什么我可以
by Pisces @ 2019-10-16 19:13:44
@wyx123456789 而且是
by wyx123456789 @ 2019-10-16 19:19:46
@Pisces
int main()
{
int K,i;
double S=0.0;
scanf("%d",&K);
for(i=1;S<K;i++)
S=S+1.0/i;
printf("%d",i);
return 0;
}
by wyx123456789 @ 2019-10-16 19:20:34
@Pisces 我在我的编译器上运行成功,但在这题交就是错的。。。
by Pisces @ 2019-10-16 19:32:25
@wyx123456789 刚卡死了,重启了,你把
by wyx123456789 @ 2019-10-16 19:42:55
@Pisces 通过了,谢谢!
by WJY01 @ 2019-10-17 21:52:45
@Pisces 为啥呢?