하다보니
2577번-숫자의 개수 본문
#include<bits/stdc++.h>
using namespace std;
int num[10];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int a;
int total=1;
for (int i = 0; i < 3; i++) {
cin >> a;
total *= a;
}
string l = to_string(total);
for (auto c : l) {
num[c - '0']++;
}
for (int i = 0; i < 10; i++)cout << num[i]<<"\n";
}
'알고리즘 풀이 > 백준' 카테고리의 다른 글
3273번-두 수의 합 (0) | 2022.01.13 |
---|---|
1475번-방 번호 (0) | 2022.01.13 |
10808번-알파벳 개수 (0) | 2022.01.13 |
10804번-카드 역배치 (0) | 2022.01.13 |
[백준 2576번]홀수 (0) | 2022.01.10 |