-
-
Save FPiorski/867d428aa2f2e0776ee03d712a99fbbe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70000/10/172 | |
40.6976744186 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) | |
{ | |
int count[10] = {}, digits[4] = {}, oldDigits[4] = {}; | |
for (int h=0; h<24; ++h) { | |
for (int m=0; m<60; ++m) { | |
digits[0] = h/10; | |
digits[1] = h%10; | |
digits[2] = m/10; | |
digits[3] = m%10; | |
for (int i=0; i<4; ++i) { | |
if (digits[i] != oldDigits[i]) | |
++count[digits[i]]; | |
oldDigits[i] = digits[i]; | |
} | |
printf("%2i:%2i | %i%i%i%i\n", h, m, digits[0], digits[1], digits[2], digits[3]); | |
} | |
} | |
for (int i=0; i<10; ++i) | |
printf("%i: %i\n", i, count[i]); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0: 168 | |
1: 172 | |
2: 172 | |
3: 171 | |
4: 170 | |
5: 170 | |
6: 146 | |
7: 146 | |
8: 146 | |
9: 146 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment