Created
January 9, 2020 03:00
-
-
Save dalcon10028/97fabe1142a7fdfa06a76ad3acccfd48 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| public class Main { | |
| public static void main(String args[]) { | |
| Scanner sc = new Scanner(System.in); | |
| while (true) { | |
| int num1 = sc.nextInt(); | |
| int num2 = sc.nextInt(); | |
| if (num1+num2==0) break; // 두 입력값이 0이면 종료 | |
| if (num2 % num1 == 0) { // 약수라면 | |
| System.out.println("factor"); | |
| } else if (num1 % num2 == 0){ // 배수라면 | |
| System.out.println("multiple"); | |
| } else { // 둘 다 아니라면 | |
| System.out.println("neither"); | |
| } | |
| } | |
| sc.close(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment