Guest User

Untitled

a guest
Feb 20th, 2018
78
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.  
  3.     public static void main (String[] args){
  4.         int a = Integer.parseInt(args[0]);
  5.         int b = Integer.parseInt(args[1]);
  6.         println ( "ggT = "+ euklid(a,b));
  7.         }
  8.  
  9.     static int euklid ( int x, int y){
  10.        
  11.         while (y != 0){
  12.             if ( x > y)
  13.                 x = x-y;
  14.         else
  15.             y = y-x;
  16.         }      
  17.         return x;
  18.         }
  19. }
Add Comment
Please, Sign In to add comment