Guest User

Untitled

a guest
Feb 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.31 KB | None | 0 0
  1. class ggt2 {
  2.     public static int main (String[] args) {
  3.         int a = Integer.parseInt(args[0]);
  4.         int b = Integer.parseInt(args[1]);
  5.        
  6.         println ("ggT = " + euklid(a,b);
  7.     }
  8.  
  9.     static int euklid (int x, int y) {     
  10.         while (y != 0){
  11.             if (x > y)
  12.                 x = x - y;
  13.             else
  14.                 y = y - x;
  15.             return x;      
  16.         }
  17.     }
  18. }
Add Comment
Please, Sign In to add comment