백준 문제/구현

[백준] 2577번 숫자의 개수

dubu0721 2025. 1. 4. 20:43

문제: 2577번: 숫자의 개수

basic-algo-lecture/workbook/0x03.md at master · encrypted-def/basic-algo-lecture

 

basic-algo-lecture/workbook/0x03.md at master · encrypted-def/basic-algo-lecture

바킹독의 실전 알고리즘 강의 자료. Contribute to encrypted-def/basic-algo-lecture development by creating an account on GitHub.

github.com

 

#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <iomanip> // setprecision을 사용하기 위한 헤더
#include <climits>

using namespace std;


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int a, b, c;
    cin >> a >> b >> c;

    int cnts[10] = {};

    int num = a * b * c;
    while (num > 0) {
        int tmp = num % 10;
        cnts[tmp]++;

        num /= 10;
    }

    for (int i = 0; i < 10; i++)
        cout << "\n";


    return 0;
}

 

음. 그냥 코드만 보고도 쉽게 이해할 수 있어서 딱히 설명은 안 적어도 될 것 같다.

 

 

 

참고자료:

BaaaaaaaarkingDog | [실전 알고리즘] 0x03강 - 배열

 

[실전 알고리즘] 0x03강 - 배열

안녕하세요, 바킹독입니다.. 저번 단원의 내용인 코드 작성 요령 II는 순한 맛이었는데 오늘건 그냥 단맛입니다. 난이도가 굉장히 낮으니 긴장 푸시고 강의로 들어가겠습니다. 목차는 따로 설명

blog.encrypted.gg