티스토리 뷰

PS/백준

2577번 숫자의 개수

unside 2019. 6. 22. 17:10

백준 2577번

문제 사이트 :
https://www.acmicpc.net/problem/2577

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>

using namespace std;

#define Max 10
int Array[Max];

int main(void) {
	int a, b, c;
	scanf("%d", &a);
	scanf("%d", &b);
	scanf("%d", &c);

	int num = a * b * c;
	int num1 = num;
	for (int i = 0; i < log10(num); i++) {
		Array[num1 % 10]++;
		num1 = num1 / 10;
	}
	for (int i = 0; i < Max; i++) {
		printf("%d\n", Array[i]);
	}
	return 0;
}

'PS > 백준' 카테고리의 다른 글

2908번 상수  (0) 2019.06.22
2675번 문자열 반복  (0) 2019.06.22
2448번 별 찍기 - 11  (0) 2019.06.22
1316번 그룹 단어 체커  (0) 2019.06.22
1157번 단어 공부  (0) 2019.06.22
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
글 보관함