Guest User

Untitled

a guest
Feb 20th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.30 KB | None | 0 0
  1. public class ggt{
  2.  
  3.     public static void main (String[] args){
  4.     System.out.print("Bitte erste Zahl angeben");
  5.     int x;
  6.     x = Stdin.readInt();
  7.     System.out.print("Bitte zweite Zahl angeben");
  8.     int y;
  9.     y = Stdin.readInt();
  10.         while(y != 0){
  11.         if(x>y)
  12.         x = x-y;
  13.         else
  14.         y = y-x;
  15.         }
  16.     return x;
  17.     }
  18. }
Add Comment
Please, Sign In to add comment