약수
-
[java]백준 배수와 약수 5086번알고리즘 문제풀이/백준(자바) 2023. 6. 4. 23:35
코드 import java.util.Scanner; public class BOJ_5086 { public static void main(String[] args) { Scanner in = new Scanner(System.in); while (true) { int a=in.nextInt(); int b=in.nextInt(); if (a==0 && b==0) { break; } if (b % a == 0) { System.out.println("factor");//약수 }else if(a%b==0){ System.out.println("multiple");//배수 }else{ System.out.println("neither");//둘 다 아니라면 } } in.close(); } } //배수 약수 링..