Advertisement
Guest User

Untitled

a guest
Feb 21st, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. package Ex07BiggestDevisor;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Try01 {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8. int num1 = Integer.parseInt(scanner.nextLine());
  9. int num2 = Integer.parseInt(scanner.nextLine());
  10.  
  11. while (num1!=0){
  12. int oldNum1 = num1;
  13. num1 = num2%num1;
  14. num2 = oldNum1;
  15. }
  16. System.out.println(num2);
  17.  
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement