LoginSignup
1
1

More than 5 years have passed since last update.

POH Lite4 エンジニアでも恋がしたい-転職初日にぶつかった女の子が同僚だった件 ミッション2

Last updated at Posted at 2014-12-08

ミッション1 / ミッション2 / ミッション3 / 共通解

https://paiza.jp/poh/enkoi
1問目を全問正解しないと2問目は読めないので、がんばって解きましょう。
がんばるほどのものでもないですが。

<?php
    $input = file('php://stdin', FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
    array_shift($input);

    $total = 0;
    foreach($input as $val){
        $tmp = explode(' ', $val);
        if($tmp[0] > $tmp[1]){
            $total += ($tmp[0] - $tmp[1]) * $tmp[2];
        }
    }
    print($total);

結果。
https://paiza.jp/poh/enkoi-third/f4809593

2問目もまだ何も考えずに解ける問題です。

1
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
1
1