結果

問題 No.418 ミンミンゼミ
ユーザー KSnitech
提出日時 2017-10-17 15:34:24
言語 Java
(openjdk 23)
結果
AC  
実行時間 136 ms / 1,000 ms
コード長 538 bytes
コンパイル時間 3,352 ms
コンパイル使用メモリ 74,368 KB
実行使用メモリ 54,204 KB
最終ジャッジ日時 2024-07-16 02:29:25
合計ジャッジ時間 7,717 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Minmin {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        String S = stdIn.nextLine();
        int counter = 0;

        while (S.indexOf("mi") == 0) {
            S = S.substring(2);
            while (S.charAt(0) == '-') {
                S = S.substring(1);
            }
            if (S.charAt(0) == 'n') {
                S = S.substring(1);
                counter++;
            }
        }

        System.out.println(counter);
    }
}
0