C++秒和小时分钟的转化_其他

#include <iostream>
using namespace std;

int main(){
	int all = 8000,s,m,h;
	s = all % 60;;
	m = all / 60 % 60;
	h = all / 60 / 60;
	cout << "8000秒=" << h << "小时" << m << "分钟" << s << "秒" << endl;
	return 0;
}