LoginSignup
1
0

More than 1 year has passed since last update.

【PHP基礎復習4】引き算②

Last updated at Posted at 2022-09-05

[問題]
ユキさんは、あるアイドルグループのファンです。
そのグループは西暦A年に結成されました。現在は西暦B年ですが、今年で何周年でしょうか。

コード

 $input1= fgets(STDIN);
 $input2= fgets(STDIN);
 echo $input2 - $input1, PHP_EOL;

↓ 2015、2022と入力

結果

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