Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- import java.util.Scanner;
- public class Main {
- public static int random(int min,int max) {
- java.util.Random randomClass = new java.util.Random();
- int generatedInteger = randomClass.nextInt(max - min) + min;
- return generatedInteger;
- public static void main(String[] args) {
- Random generator = new Random(100);
- int x = random(50, 100);
- int y = random(50, 100);
- int z = x + y;
- System.out.print(x + " + ");
- System.out.println(y);
- Scanner scanner = new Scanner(System.in);
- if a = z; {
- return a;
- }
- int a = scanner.nextInt();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement