3 条题解
-
0
#include<iostream> #include<iomanip> using namespace std; int main(){ int h , m , s , t; cin >> h >> m >> s >> t; s = t + s; m = s / 60 + m; h = m / 60 + h; bool a; if(h % 24 < 12){ a = true; }else{ a = false; } if(h % 24 == 0 || h % 24 == 12){ cout << 12 << ":"; }else{ cout << h % 12 << ":"; } cout << m % 60 << ":" << s % 60; if(a){ cout << "am"; }else{ cout << "pm"; } cout << endl; cout << fixed << setprecision(2) << 1.0 * t / 3600 / 24 * 100 << "%";
return 0;
}
信息
- ID
- 32
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 9
- 标签
- 递交数
- 423
- 已通过
- 45
- 上传者