4 条题解

  • 1
    @ 2025-9-28 13:46:44
    #include <stdio.h>
    int t;
    float s, v; // 由于旅行耗时不一定是整小时数, 此处需用 float 提高运算精度
    int main()
    {
    	scanf("%d %f %f", &t, &s, &v);
    	t = t / 100 * 60 + t % 100; // 将输入得到的 t 转换为秒数
    	t += s / v * 60; // 算上旅行耗时, 其中 t = s / v 由速度公式 v = s / t 得出 // 注意单位换算
    	printf("%d-%d\n", t / 60 % 24, t % 60);
    	return 0;
    }
    
    • 0
      @ 2023-5-2 21:34:58
      #include <iostream>
      #include <bits/stdc++.h>
      using namespace std;
      const int N=1e7+10;
      const int INF=0x3f3f3f3f;
      int main()
      {
      	int t,shi,fen;
      	double l,s,zzt;
      	cin>>t>>l>>s;
      	fen=t%100;
      	shi=t/100;
      	zzt=l/s*60;
      	while(zzt>=60)
      	{
      		zzt-=60;
      		shi+=1;
      		if(shi>=24)
      		{
      			shi=0;
      		}
      	}
      	fen+=zzt;
      	if(fen>=60)
      	{
      		shi+=(fen/60);
      		fen-=(fen/60)*60;
      	}
      	if(shi>=24)
      	{
      		shi=0;
      		shi+=(fen/60);
      	}
      	cout<<shi<<"-"<<fen;
      }
      
      • -1
        @ 2024-1-30 11:12:58
        #include<iomanip>//setprecision setw
        #include<stdio.h>//scanf printf
        #include<math.h>//ceil floor fabs sqrt round pow
        #include<string>//string
        #include<string.h>//memset
        #include<sstream>//stringsream
        #include<algorithm>//min max
        using namespace std;
        int n,t;
        double a,b;
        int main(){
        	cin>>n>>a>>b;
        	t=n/100*60+n%100+a/b*60;
        	cout<<t/60%24<<"-"<<t%60;
        	return 0;
        }
        
        
        • -1
          @ 2023-3-18 11:58:54
          #include<iostream>//cin cout
          #include<iomanip>//setprecision setw
          #include<stdio.h>//scanf printf
          #include<math.h>//ceil floor fabs sqrt round pow
          #include<string>//string
          #include<string.h>//memset
          #include<sstream>//stringsream
          #include<algorithm>//min max
          using namespace std;
          int n,t;
          double a,b;
          int main(){
          	cin>>n>>a>>b;
          	t=n/100*60+n%100+a/b*60;
          	cout<<t/60%24<<"-"<<t%60;
          	return 0;
          }
          
          • 1

          信息

          ID
          1498
          时间
          1000ms
          内存
          256MiB
          难度
          8
          标签
          递交数
          232
          已通过
          30
          上传者