Lang:G++
Edit12345678910111213141516171819202122232425262728#include <iostream>#include <cstdio>using namespace std;int getCnt(int num){int cnt = 0;while(num){if(num & 1)++cnt;num >>= 1;}return cnt;}int main(){int x;// freopen("week181_p1.in", "r", stdin);scanf("%d", &x);for(int i = 0; i < 24; ++i)for(int j = 0; j < 60; ++j)if(getCnt(i) + getCnt(j) == x)printf("%.2d:%.2d\n", i, j);return 0;}