mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-07-08 02:13:51 +08:00
Update: Rename folder name to XSMOJ
This commit is contained in:
18
XSMOJ/「NOIP 2002 普及组」级数求和.cpp
Normal file
18
XSMOJ/「NOIP 2002 普及组」级数求和.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
#include <ctime>
|
||||
#include <cmath>
|
||||
using namespace std;
|
||||
int main(){
|
||||
double a,sum=0;
|
||||
int b=0;
|
||||
scanf("%lf",&a);
|
||||
while(sum<=a){
|
||||
b++;
|
||||
sum+=1*1.0/b;
|
||||
}
|
||||
printf("%d",b);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user