結果

問題 No.418 ミンミンゼミ
ユーザー shinwisteria
提出日時 2017-03-30 22:41:13
言語 Java
(openjdk 23)
結果
AC  
実行時間 124 ms / 1,000 ms
コード長 380 bytes
コンパイル時間 4,184 ms
コンパイル使用メモリ 77,924 KB
実行使用メモリ 41,584 KB
最終ジャッジ日時 2024-07-16 02:19:24
合計ジャッジ時間 7,032 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Minminzemi {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String S = s.nextLine();
		s.close();
		int count = 0;
		while(S.length() != 0){
			int end = S.indexOf("n",0);
			count++;
			if(end != S.length()){
				S = S.substring(end+1);
			}else{
				break;
			}
		}
		System.out.println(count);

	}

}
0