下面是本题AC代码,如有不足,请dalao指教
查看原帖
下面是本题AC代码,如有不足,请dalao指教
1304107
yaozewei楼主2024/3/11 21:41
#include <bits/stdc++.h>
using namespace std;
int main(){
	int h1,f1,h2,f2;//定义起始与结束时间 
	cin >> h1 >> f1 >> h2 >> f2;
	int num1 = h1*60+f1;//转化为分(统一单位) 
	int num2 = h2*60+f2;
	int score = num2 - num1;//时间差 
	cout << score / 60 << " " << score % 60 <<endl;//最后输出时和分 
	return 0;//最后?直接AC!!! 
}
2024/3/11 21:41
加载中...