public class Main {
public static void main(String[] args) {
double rand = Math.random(); * 100;
//Assign a variable to a variable
int number = (int)rand;
System.out.println(number);
}
}
In that case, enclose it in ().
int game_num = (int)(Math.random() * 10 + 1);
System.out.println("The number of games" + game_num + "Pieces");
Recommended Posts