4 条题解

  • 0
    @ 2025-9-13 22:21:40

    经典华罗庚在火车上的题

    from math import sqrt,ceil,gcd,log;re=lambda:map(int,input().strip().split())
    
    t, = re()
    for _ in range(t):
        m, x, y, z = re()
        print(f"{m * x * z / (y - x):.2f}")
    
    • 0
      @ 2025-1-1 15:39:48
      #include<bits/stdc++.h>
      using namespace std;
      
      int main()
      {
      	int n;
      	cin>>n;
      	int m,x,y,z;
      	double t,s;
      	while(n--)
      	{
      		cin>>m>>x>>y>>z;
      		t = x*m*1.00/(y-x);
      		s = t*z;
      		cout<<fixed<<setprecision(2)<<s<<endl;
      	}
      }
      
      • 0
        @ 2024-10-15 8:13:14

        和上面学长讲的一样

        #include <stdio.h>

        int main()

        {

        int n;

        scanf("%d",&n);

        for(int i=0;i<n;i++){

        double m,x,y,z;

        scanf("%lf %lf %lf %lf",&m,&x,&y,&z);

        double dichu=m*x;

        double c=0.0;

        c=(dichu)/(y-x);

        double k=c*z;

        printf("%.2lf\n",k);

        }

        return 0;

        }

        • 0
          @ 2023-9-4 22:19:26

          //解题思路:求出哥哥追上弟弟的时间,再用时间乘以狗的速度。 #include <stdio.h> #include <stdlib.h>

          int main() { int n; scanf("%d",&n); while(n--) { int m,x,y,z,t; double s; scanf("%d %d %d %d",&m,&x,&y,&z); if(y>x&&y<z)//限定条件 { t=(mx)/(y-x);//哥哥追上弟弟的时间 s=zt; printf("%.2lf\n",s); } } return 0; }

          • 1

          信息

          ID
          160
          时间
          3000ms
          内存
          128MiB
          难度
          6
          标签
          (无)
          递交数
          844
          已通过
          237
          上传者