본문 바로가기

Algorithm

C++(씨쁠쁠)(cplusplus)-백준(baekjoon)(BaekJoon)코딩 4504번:배수 찾기 답

반응형
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
using namespace std;
int main() {
    int n;
    cin >> n;
    while (1)
    {
        int x;
        cin >> x;
        if (x == 0) { break; }
        if (x % n == 0)
            cout << x << " is a multiple of "<<n<<'.'<<'\n';
        else
            cout << x << " is NOT a multiple of "<<n<<'.'<<'\n';
    }
}
cs