[백준] 5086번 : 배수와 약수 - C++

강재원·2022년 10월 2일
0

[코딩테스트] C/C++

목록 보기
86/200



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

#include <iostream>

using namespace std;

int main() {
    for(;;){
        int a,b;
        cin>>a>>b;
        if(a==0&&b==0) break;
        if(a>=b&&a%b==0) cout<<"multiple"<<"\n";
        else if(b>=a&&b%a==0) cout<<"factor"<<"\n";
        else cout<<"neither"<<"\n";
    }
}
profile
개념정리 & 문법 정리 & 알고리즘 공부

0개의 댓글