2
1

More than 1 year has passed since last update.

paiza問題集から組になったデータの入力(PHP)

Posted at

paizaの標準入力問題集から組になったデータの入力をPHPで実装しました。
今回は8番目のデータを標準出力で出力します。

 //データの個数を入力する
 $num = trim(fgets(STDIN));
    for($i=1;$i<=$num;$i++){
//データを入力する
        $data = trim(fgets(STDIN));
//8番目のデータの場合、標準出力に出力する。
        if($i == 8){
            echo $data;
        }
    }

以上のコードになります。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1