Trung is bored with his mathematics homeworks. He takes a piece of chalk and starts writing a sequence of consecutive integers starting with 1 to N (1 < N < 10000). After that, he counts the number of times each digit (0 to 9) appears in the seque…
Trung is bored with his mathematics homeworks. He takes a piece of chalk and starts writing a sequence of consecutive integers starting with 1 to N (1 < N < 10000) . After that, he counts the number of times each digit (0 to 9) appears in the sequen…
#include <stdio.h>#include <string.h> int main(){ int T, N, i, j; int a[10]; scanf("%d", &T); while (T--) { memset(a, 0, sizeof(a)); scanf("%d", &N); for (i = 1; i <= N; ++i) …