daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10.     public static void main (String[] args) throws java.lang.Exception
  11.     {
  12.     int num = 7;
  13.     int den = 14;
  14.     int max = den;
  15.     for(int i = 1; i < max; i++){
  16.         if(num % i == 0 && den % i == 0){
  17.             num = num/i;
  18.             den = den/i;
  19.         }
  20.     }
  21.    
  22.     System.out.println(num +"/" + den);
  23.     }
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top