문제 출처:https://www.acmicpc.net/problem/2577
2577번: 숫자의 개수
첫째 줄에 A, 둘째 줄에 B, 셋째 줄에 C가 주어진다. A, B, C는 모두 100보다 크거나 같고, 1,000보다 작은 자연수이다.
www.acmicpc.net

문제를 해결하는데 큰 어려움은 없었습니다. 코드는 다음과 같습니다:
#include <iostream>
using namespace std ;
int main(){
ios::sync_with_stdio(false) ;
cin.tie(NULL) ; cout.tie(NULL) ;
int a, b, c ;
cin >> a >> b >> c ;
long long product = a * b * c ;
int nums_cnt[10] = {0, };
while(product != 0){
nums_cnt[product%10] += 1 ;
product /= 10 ;
}
for(auto num : nums_cnt)
cout << num << endl ;
return 0 ;
}
해당 문제는 Github에서도 보실 수 있습니다:
https://github.com/gurcks8989/CodingTest/blob/master/BackJoon/HPS/P2577_Numbers.cpp
GitHub - gurcks8989/CodingTest: CodingTest_study_with_c++
CodingTest_study_with_c++. Contribute to gurcks8989/CodingTest development by creating an account on GitHub.
github.com
훈수 및 조언은 언제든 환영입니다.
문제 출처:https://www.acmicpc.net/problem/2577
2577번: 숫자의 개수
첫째 줄에 A, 둘째 줄에 B, 셋째 줄에 C가 주어진다. A, B, C는 모두 100보다 크거나 같고, 1,000보다 작은 자연수이다.
www.acmicpc.net

문제를 해결하는데 큰 어려움은 없었습니다. 코드는 다음과 같습니다:
#include <iostream>
using namespace std ;
int main(){
ios::sync_with_stdio(false) ;
cin.tie(NULL) ; cout.tie(NULL) ;
int a, b, c ;
cin >> a >> b >> c ;
long long product = a * b * c ;
int nums_cnt[10] = {0, };
while(product != 0){
nums_cnt[product%10] += 1 ;
product /= 10 ;
}
for(auto num : nums_cnt)
cout << num << endl ;
return 0 ;
}
해당 문제는 Github에서도 보실 수 있습니다:
https://github.com/gurcks8989/CodingTest/blob/master/BackJoon/HPS/P2577_Numbers.cpp
GitHub - gurcks8989/CodingTest: CodingTest_study_with_c++
CodingTest_study_with_c++. Contribute to gurcks8989/CodingTest development by creating an account on GitHub.
github.com
훈수 및 조언은 언제든 환영입니다.