- 级数求和
- 2015-06-30 11:31:03 @
#include<iostream>
#include<cstring>
#include <cstdio>
using namespace std;
////////////////////
float m,n,s;
int k,i;
////////////////////
int main()
{
scanf("%d",k);
s=0;
i=1;
while (s<=k){
s+=1/i;
i++;
}
printf("%d",i);
}
1 条评论
-
twd2 LV 9 MOD @ 2015-07-03 21:24:53
scanf("%d",k);
似乎应该是
scanf("%d", &k);
- 1