Advertisement
AmidamaruZXC

Untitled

Oct 14th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.20 KB | None | 0 0
  1.     public int gcd(int x, int y)
  2.     {
  3.         int t;
  4.        
  5.         while(y != 0)
  6.         {
  7.             t = y;
  8.             y = x%y;
  9.             x = t;
  10.         }
  11.         return Math.abs(x);
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement