#include<iostream> #include<string> using namespace std; int main() { int T; cin >> T; while (T--) { int n,y,r,h,m,s; scanf("%d/%d/%d-%d:%d:%d", &n, &y, &r,&h,&m,&s); string str("am"); if (h >= 12)str = "pm"; h %= 12; if (h == 0)h = 12; printf("%.2d/%.2d/%d-%.2d:%.2d:%.2d", y, r, n, h, m, s); cout << str << endl; } } /* F:\temp\22490744.24274\Main.cc: In function 'int main()': F:\temp\22490744.24274\Main.cc:9: error: 'scanf' was not declared in this scope F:\temp\22490744.24274\Main.cc:14: error: 'printf' was not declared in this scope */ |
Double click to view unformatted code.