Skip to content

Instantly share code, notes, and snippets.

@bkyrlach
Created February 12, 2020 23:39
Show Gist options
  • Select an option

  • Save bkyrlach/5aa379d42cdd6f8daee657955e89b9b8 to your computer and use it in GitHub Desktop.

Select an option

Save bkyrlach/5aa379d42cdd6f8daee657955e89b9b8 to your computer and use it in GitHub Desktop.
package com.kyrlach.hello;
import java.util.Random;
import java.util.Scanner;
public class Program {
public static void main(String[] args) {
Random r = new Random();
Scanner s = new Scanner(System.in);
Integer x = s.nextInt();
if(x < 99) {
for(int i = 0; i < x; i++) {
Integer rng = r.nextInt(10) + 1;
System.out.print(rng.toString());
System.out.print(" : ");
}
} else {
System.out.println("Get lost.");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment