Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- foo();
- }
- static void foo() {
- int src = getProperRand();
- System.out.println("scr = " + src);
- int dst = getProperRand();
- int count = 1;
- while (src != dst){
- dst = getProperRand();
- count++;
- }
- System.out.println("count = " + count);
- }
- static int getProperRand() {
- int rand = new Random().nextInt(10_000_000);
- int l = 1_000_000;
- return l + rand;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement