기록장
TODAY TOTAL
[배열 | 기본문제] 2577번 : 숫자의 개수

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

 

2577번: 숫자의 개수

첫째 줄에 A, 둘째 줄에 B, 셋째 줄에 C가 주어진다. A, B, C는 모두 100보다 크거나 같고, 1,000보다 작은 자연수이다.

www.acmicpc.net


#include<bits/stdc++.h>
using namespace std;

int freq[10];
int a,b,c;

int main()
{
	std::ios::sync_with_stdio(0);
	std::cin.tie(0);
	
	cin >> a >> b >> c;
	string s = to_string(a * b * c);

	for (auto num : s)
		freq[num - '0']++;
	for (int i = 0; i < 10; i++)
		cout << freq[i] << '\n';

}
  Comments