为什么我这个不给过啊 求解

P1035 [NOIP2002 普及组] 级数求和

a2539660209 @ 2018-12-07 23:01:11

include<stdio.h>

int main() { int i,k; float s; scanf("%d",&k); s=0; for(i=1;;i++) { s=s+1.0/i; if(s>k) break; } printf("%d",i); return 0; }


by Zenurik @ 2018-12-07 23:23:01

希望更丰富的展现?使用Markdown


by noall @ 2018-12-07 23:28:26

希望更丰富的展现?使用Markdown\LaTeX


by lemir3 @ 2018-12-07 23:41:05

所以这是评测姬拟人吗


by mcyqwq @ 2018-12-08 08:01:51

L^AT_EX

by mengzihan @ 2018-12-10 14:34:54

include<cstdio>

include<iostream>

using namespace std; int main() { float s=0,n=0,k; cout<<"k="; cin>>k; do { n++; s=s+1/n; } while(s<=k); cout<<n; return 0; } 我这也不给过??????


|