#34715: 000


yp11151144@yphs.tp.edu.tw (709-35陳中仁)

學校 : 臺北市私立延平高級中學
編號 : 197065
來源 : [203.72.178.1]
最後登入時間 :
2023-06-19 14:39:34
d073. 分組報告 -- 板橋高中教學題 | From: [203.72.178.1] | 發表日期 : 2023-04-10 14:27

#include <bits/stdc++.h>

using namespace std;

int main() {
    int ts, h, m, s;
    cout << "請輸入秒數: ";
    cin >> ts;
    h = ts / 60 / 60;
    m = ts / 60 % 60;
    s = ts % 60;
    cout << h << ":" << m << ":" << s << endl;
    printf("%d:%d:%d\n", h, m, s);
    printf("%2d:%2d:%2d\n", h, m, s);
    printf("%02d:%02d:%02d\n", h, m, s);
}

 
ZeroJudge Forum