微长
查看原帖
微长
1098009
tees_of_times楼主2024/7/14 10:10
#include <iostream>
using namespace std;
int a(int k){
    int n=1;
    double b=0.0;
    
    while(true){
        b+=1.0/n;
        if (b>k){
            return n;
        }
        n++;
    }
}
int main(){
    int k;
    cin>>k;
    int c=a(k);
    cout<<c<<endl;
    return 0;
}

求改

2024/7/14 10:10
加载中...