class Saicoro {
public static void main(String[] args) {
double rand = Math.random() * 6 + 1;
System.out.println("サイコロの目は" + (int)rand + "です");
}
}
コンパイル&実行コマンド↓
% 【java saicoro.java】
More than 3 years have passed since last update.
class Saicoro {
public static void main(String[] args) {
double rand = Math.random() * 6 + 1;
System.out.println("サイコロの目は" + (int)rand + "です");
}
}
コンパイル&実行コマンド↓
% 【java saicoro.java】
Register as a new user and use Qiita more conveniently