bitset是个好东西
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; for (int i = 1; i <= t;i++){ int a, b, c; scanf("%d:%d:%d", &a, &b, &c); bitset<6> aa(a); bitset<6> bb(b); bitset<6> cc(c); cout << i << " "; for (int j = 5; j >= 0;j--) cout << aa[j] << bb[j] << cc[j]; cout << " " << aa << bb << cc << endl; } }
bitset是个好东西