Notice
Recent Posts
Recent Comments
Link
«   2026/06   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Archives
Today
Total
관리 메뉴

dh-winternagi 님의 블로그

(5086) 배수와 약수 본문

백준 (C++)/Solve

(5086) 배수와 약수

dh-winternagi 2026. 4. 11. 09:50

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