Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Ex07BiggestDevisor;
- import java.util.Scanner;
- public class Try01 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int num1 = Integer.parseInt(scanner.nextLine());
- int num2 = Integer.parseInt(scanner.nextLine());
- while (num1!=0){
- int oldNum1 = num1;
- num1 = num2%num1;
- num2 = oldNum1;
- }
- System.out.println(num2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement