0分求调
查看原帖
0分求调
1070309
BUS_109_159_18楼主2025/7/29 18:42

样例输出很奇怪

# include <bits/stdc++.h>
# define int long long

using namespace std;

int n;

void printt ( int x ) {
	
	if ( x <= 9 ) cout << "0" << x;
	return ;
	
}

signed main( ) {
	
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	
	cin >> n;
	
	n = n % ( 60 * 60 * 24 * 1000 );
	n /= 1000;
	
	printt( n/3600 ); cout << ":";
	
	printt( n%3600/60 ); cout << ":";
	
	printt( n%60 );
	
	return 0;
}

一会是 25 行的printt无法输出,一会是 29 行的printt无法输出

样例1:

IN:

46800999

OUT:

:00:00

样例2:

IN:

1618708103123

OUT:

01:08:

回复必关

2025/7/29 18:42
加载中...