/
Time Limit: 2 sec / Memory Limit: 1024 MiB
配点 : 100 点
問題文
3 種類の文字 . | * からなる、長さ N の文字列 S が与えられます。
S には | がちょうど 2 つ、* がちょうど 1 つ含まれます。
2 つの | で囲まれた部分の中に * が含まれるか判定してください。
含まれている場合 in と、含まれていない場合 out と出力してください。
より厳密には、* より前にある文字のいずれかが | であり、かつ、* より後ろにある文字のいずれかが | であるか判定してください。
制約
- 3\leq N\leq 100
- N は整数
- S は
.|*からなる長さ N の文字列 - S に
|はちょうど 2 個含まれる - S に
*はちょうど 1 個含まれる
入力
入力は以下の形式で標準入力から与えられる。
N S
出力
2 つの | に囲まれた部分の中に * が含まれている場合 in と、含まれていない場合 out と 1 行に出力せよ。
入力例 1
10 .|..*...|.
出力例 1
in
2 つの | に囲まれた部分は |..*...| です。
この中に * が含まれているため、in と出力してください。
入力例 2
10 .|..|.*...
出力例 2
out
2 つの | に囲まれた部分は |..| です。
この中に * は含まれていないため、out と出力してください。
入力例 3
3 |*|
出力例 3
in
Score : 100 points
Problem Statement
You are given a string S of length N consisting of three kinds of characters: ., |, and *.
S contains exactly two | and exactly one *.
Determine whether the * is between the two |, and if so, print in; otherwise, print out.
More formally, determine whether one of the characters before the * is | and one of the characters after the * is |.
Constraints
- 3\leq N\leq 100
- N is an integer.
- S is a string of length N consisting of
.,|, and*. - S contains exactly two
|. - S contains exactly one
*.
Input
The input is given from Standard Input in the following format:
N S
Output
Print a single line containing in if the * is between the two |, and out otherwise.
Sample Input 1
10 .|..*...|.
Sample Output 1
in
Between the two |, we have |..*...|, which contains *, so you should print in.
Sample Input 2
10 .|..|.*...
Sample Output 2
out
Between the two |, we have |..|, which does not contain *, so you should print out.
Sample Input 3
3 |*|
Sample Output 3
in