2 条题解

  • 0
    @ 2025-6-1 16:57:17
    h = int(input())
    s = h
    for i in range(2, 11):
        s += h
        h /= 2
    print(f'{s:.6g}')
    print(f'{h/2:.6g}')
    
    • 0
      @ 2025-5-31 12:06:59
      #include<cstdio>
      using namespace std;
      int main(){
      	double h; int i=1;
      	scanf("%lf",&h);
      	double s=h;
      	do
      	{
      		h/=2;
      		s+=h*2;
      		++i;
      	}while(i<=9);
      	printf("%g\n%g",s,h/2);
      	return 0;
      }
      

      提示:输出时不需要对精度特殊控制,用cout << ANSWER,或者printf("%g",ANSWER)即可。

      • 1

      信息

      ID
      267
      时间
      1000ms
      内存
      256MiB
      难度
      8
      标签
      递交数
      16
      已通过
      5
      上传者