dh-winternagi 님의 블로그
(5086) 배수와 약수 본문
https://www.acmicpc.net/problem/5086
단계별로 풀어보기
9단계(약수, 배수와 소수 1) 1번째

#include <iostream>
using namespace std;
int main() {
while(true){
int a, b;
cin >> a >> b;
if(!a) break;
if(b%a==0) cout << "factor\n";
else if(a%b==0) cout << "multiple\n";
else cout << "neither\n";
}
return 0;
}'백준 (C++) > Solve' 카테고리의 다른 글
| (9506) 약수들의 합 (0) | 2026.04.11 |
|---|---|
| (2501) 약수 구하기 (0) | 2026.04.11 |
| (2869) 달팽이는 올라가고 싶다 (0) | 2026.04.11 |
| (1193) 분수찾기 (0) | 2026.04.11 |
| (2292) 벌집 (0) | 2026.04.11 |
