2 条题解

  • 1
    @ 2025-8-2 22:25:17
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	double x,a=2,b=0;
    	cin>>x;
    	while(x>0)
    	{
    		x-=a;
    		a*=0.98;
    		b++;
    	}
    	cout<<b;
    	return 0;
    }
    
    • 0
      @ 2024-11-17 21:19:23

      #include<bits/stdc++.h> using namespace std; double n,o=2,cnt; int main() { cin>>n; for(int i=1;;i++) { if(n<=0) break; n-=o; o*=0.98; cnt++; } cout<<cnt; return 0;//仅供参考 }

      • 1

      信息

      ID
      104
      时间
      1000ms
      内存
      64MiB
      难度
      10
      标签
      递交数
      5
      已通过
      4
      上传者