結果

問題 No.418 ミンミンゼミ
ユーザー cande398
提出日時 2017-10-08 15:52:52
言語 Java
(openjdk 23)
結果
AC  
実行時間 121 ms / 1,000 ms
コード長 384 bytes
コンパイル時間 2,110 ms
コンパイル使用メモリ 74,836 KB
実行使用メモリ 54,320 KB
最終ジャッジ日時 2024-07-16 02:27:57
合計ジャッジ時間 5,727 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
  public static void main(String[] args){
    int i, count = 0;
    Scanner sc = new Scanner(System.in);
    String input = sc.next();
    if(input.charAt(input.length()-1) != 'n')count--;
    String[] line = input.split("n");
    for(i=0;i<line.length;i++){
      if(line[i].matches("mi-*"))count++;
    }
    System.out.println(count);
  }
}
0