[C++] 2577 : 숫자의 개수

리폐·2023년 9월 15일

백준

목록 보기
2/18

2577 : 숫자의 개수

제출 코드

#include <iostream>
using namespace std;

int main() {
	int a, b, c, temp = 0;
	int arr[10] = {}; //최대 자리수 길이 10자리 
	cin >> a >> b >> c;
	temp = a * b * c;

	while (temp != 0) {
		arr[temp % 10]++; /*temp % 10 << 자리수 표시*/
		temp /= 10;
    }

	for (int i : arr) {
		cout << i << "\n";
	}
}
profile
Unreal 5, Unity 공부

0개의 댓글