페이지

2577번: 숫자의 개수

https://www.acmicpc.net/problem/2577


$O(1)$


#include<cstdio>
int a[10], x, y, z;
int main() {
    scanf("%d %d %d", &x, &y, &z);
    for (int i = x*y*z; i; i /= 10) a[i % 10]++;
    for (int i = 0; i < 10; i++) printf("%d\n", a[i]);
    return 0;
}

댓글 없음 :

댓글 쓰기