no message
This commit is contained in:
19
Question03-if/Ex06.php
Normal file
19
Question03-if/Ex06.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
$limitNumber = 100;
|
||||
|
||||
// ランダムで数字を生成するプログラムです。
|
||||
// 下記の命令を実行すると変数randomに、0以上、変数limitNumber未満の数字がランダムで代入されます
|
||||
$random = mt_rand(0, $limitNumber);
|
||||
|
||||
|
||||
/* TODO:
|
||||
* 以下の仕様に沿ってプログラムを完成させてください
|
||||
*
|
||||
* ●変数randomの値から、出力する値を変更します。
|
||||
* ●1%の確率 -> 「☆☆☆☆☆」 >> 要は1/100なので0と一致するようにしてください
|
||||
* ●30%の確率 -> 「☆☆☆☆」 >> 1~30の30個の数字が当てはまるようにしてください
|
||||
* ●上記以外の場合 -> 「☆☆☆」
|
||||
*
|
||||
* ※ プログラムは何行書いても良いです
|
||||
*/
|
||||
Reference in New Issue
Block a user