結果

問題 No.418 ミンミンゼミ
ユーザー shinwisteriashinwisteria
提出日時 2017-03-30 22:41:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 116 ms / 1,000 ms
コード長 380 bytes
コンパイル時間 3,363 ms
コンパイル使用メモリ 72,084 KB
実行使用メモリ 56,208 KB
最終ジャッジ日時 2023-09-23 01:49:12
合計ジャッジ時間 7,478 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
56,036 KB
testcase_01 AC 113 ms
56,012 KB
testcase_02 AC 114 ms
55,476 KB
testcase_03 AC 114 ms
56,128 KB
testcase_04 AC 112 ms
55,924 KB
testcase_05 AC 113 ms
56,080 KB
testcase_06 AC 113 ms
55,908 KB
testcase_07 AC 113 ms
55,716 KB
testcase_08 AC 115 ms
55,696 KB
testcase_09 AC 114 ms
56,088 KB
testcase_10 AC 115 ms
55,932 KB
testcase_11 AC 116 ms
55,896 KB
testcase_12 AC 115 ms
55,700 KB
testcase_13 AC 116 ms
55,900 KB
testcase_14 AC 115 ms
55,956 KB
testcase_15 AC 111 ms
56,080 KB
testcase_16 AC 112 ms
56,036 KB
testcase_17 AC 113 ms
56,208 KB
testcase_18 AC 114 ms
55,696 KB
testcase_19 AC 112 ms
56,192 KB
testcase_20 AC 113 ms
55,720 KB
testcase_21 AC 113 ms
55,836 KB
testcase_22 AC 115 ms
56,200 KB
testcase_23 AC 114 ms
53,656 KB
testcase_24 AC 114 ms
55,636 KB
testcase_25 AC 115 ms
55,652 KB
権限があれば一括ダウンロードができます

ソースコード

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