0
0

灰色15級がABC322をpythonでやってみた。

Posted at

初めまして。あおぷと.zipです。久しぶりにAtCoderをやってみました。
やったのはABC322です。
ちなみに解けたのはA問題だけです。

A - First ABC 2

問題

問題文と入出力例を見てみると

2行目の入力の中で初めて"ABC"が出てくるのは何文字目か。

ということです。

main.py
input()
line = input()
answer = line.find("ABC")

if answer == -1:
    print(answer)
else:
    print(answer+1)

1行目の入力はpythonでは不要なのでinput()だけ入れて飛ばしています。

0
0
1

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