結果

問題 No.341 沈黙の期間
ユーザー kenji_shioya
提出日時 2016-05-29 17:18:09
言語 Java
(openjdk 23)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 480 bytes
コンパイル時間 3,404 ms
コンパイル使用メモリ 75,488 KB
実行使用メモリ 54,460 KB
最終ジャッジ日時 2024-10-07 17:42:05
合計ジャッジ時間 6,137 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Exercise32{
  public static void main (String[] args){

    Scanner sc = new Scanner(System.in);

    String str = sc.next();
    char[] charArray = str.toCharArray();
    int count = 0;
    int max = 0;

    for (int n = 0; n < charArray.length; n++){
      if(charArray[n] == '…'){
          count++;
      }else if (charArray[n] != '…'){
        count = 0;
      }
      max = Math.max(max, count);
    }
    System.out.println(max);
  }
}
0