/* -------------------------------------------------- 乱数の表示 その2(1から100まで)Rand_02 -------------------------------------------------- */ import java.io.*; class Rand_02 { public static void main(String[] args) throws Exception { int ransu; /* ---------------------------------------- 乱数の生成 Math.random() 乱数の値は0.0〜1.0未満の実数 ---------------------------------------- */ for (int n=0 ; n<100 ; n++ ) { ransu=(int)(Math.random()*100+1); System.out.print(ransu); System.out.print("\n"); } } }