【ループメニュー1】> 【a ~ z までを表示】STEP: 2 ある数字までの出力 2 (paizaランク D 相当) [難易度: 891 ±24]
※リンク先へ移動するためには[paiza]へのログインが必要です。

正の整数 N が与えられます。
1 ~ N の整数を 1 から順に改行区切りで出力してください。
入力値(例)
1
出力値(例)
1
解答例
1 2 3 4 5 6 |
<?php $n = trim(fgets(STDIN)); for($i = 1; $i <= $n; $i++) { echo $i. "\n"; } ?> |
