Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- public class RunRational {
- public static void main(String[] args) {
- Random rnd = new Random();
- int a, b;
- a = rnd.nextInt(100);
- b = 1 + rnd.nextInt(100);
- Rational r = new Rational(a, b);
- System.out.println(r);
- a = rnd.nextInt(100);
- b = 1 + rnd.nextInt(100);
- Rational r1 = new Rational(a, b);
- System.out.println(r1);
- while (!r.isEqual(r1)) {
- a = rnd.nextInt(100);
- b = 1 + rnd.nextInt(100);
- r1 = new Rational(a, b);
- System.out.println(r1);
- }
- System.out.println("**********************");
- System.out.println(r);
- System.out.println(r1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement