7 条题解

  • 2
    @ 2023-3-18 20:17:17
    #include <queue>
    #include <math.h>
    #include <stack>
    #include <stdio.h>
    #include <iostream>
    #include <vector>
    #include <iomanip>
    #include <string.h>
    #include <algorithm>
    #include <bits/stdc++.h>
    int k,i;
    using namespace std;
    int main(){
        cin>>k;
    	double ans=1;
    	for(i=2;ans<=k;i++){
    		ans+=1.0/i;
    	}
    	cout<<i-1;
    	return 0;
    }
    
    • 1
      @ 2023-3-12 18:50:07
      #include<bits/stdc++.h>
      using namespace std;
      int k,i;
      int main()
      {
      	cin>>k;
      	double ans=1;
      	for(i=2;ans<=k;i++)
      	{
      		ans+=1.0/i;
      	}
      	cout<<i-1;
      	return 0;
      }
      
      • 1
        @ 2023-1-4 22:17:21

        #include<iostream> #include<cmath> #include<math.h> #include<iomanip> using namespace std; int main() { double s = 0; int n = 0, k; cin>>k; while(s <= k) { n++; s += 1.0 / n; } cout<<n; return 0; }

        
        
        • 1
          @ 2023-1-3 11:17:58
          #include<bits/stdc++.h>
          using namespace std;
          int k,i;
          int main()
          {
          	cin>>k;
          	double ans=1;
          	for(i=2;ans<=k;i++)
          	{
          		ans+=1.0/i;
          	}
          	cout<<i-1;
          	return 0;
          }
          
          • 1
            @ 2022-10-18 17:23:39
            #include<iostream> 
            using namespace std; 
            int main() 
            { 
                int n,cnt=1; 
                long double sum=0; 
                cin>>n; 
                while(sum<=n) 
                { 
                    sum+=1.0/cnt; 
                    cnt++; 
                } 
                cout<<cnt-1; 
                return 0; 
            }
            
            • 0
              @ 2023-12-4 23:12:08
              #include<iostream>
              using namespace std;
              int main(){
              	double k,s=0,a=0;
              	cin>>k;
              	while(s<=k){
              		a++;
              		s=s+1/a;
              	}
              	cout<<a;
              }
              
            • 0
              @ 2022-10-18 17:18:16

              #include<iostream> using namespace std; int main() { int n,cnt=1; long double sum=0; cin>>n; while(sum<=n) { sum+=1.0/cnt; cnt++; } cout<<cnt-1; return 0; }

              • 1

              信息

              ID
              656
              时间
              1000ms
              内存
              256MiB
              难度
              4
              标签
              递交数
              254
              已通过
              114
              上传者