[백준/C++] 4504 - 배수 찾기

orangesnail·2025년 5월 13일

백준

목록 보기
108/169

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


정답

#include <iostream>
using namespace std;

int main() {
    int n;
    cin >> n;

    while (true) {
        int num;
        cin >> num;

        if (!num) break;

        if (num % n == 0)
            cout << num << " is a multiple of " << n << "." << endl;
        else
            cout << num << " is NOT a multiple of " << n << "." << endl;
    }

    return 0;
}
profile
초보입니다. 피드백 환영합니다 😗

0개의 댓글