結果

問題 No.341 沈黙の期間
ユーザー mizunomi32
提出日時 2016-02-28 22:50:48
言語 Java
(openjdk 23)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 584 bytes
コンパイル時間 3,305 ms
コンパイル使用メモリ 74,304 KB
実行使用メモリ 54,468 KB
最終ジャッジ日時 2024-09-24 12:21:46
合計ジャッジ時間 5,814 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #



import java.util.Scanner;

public class main {
    public static void main(String[] args){
        Scanner sc= new Scanner(System.in);
        String S = sc.next();
        char[] chars = S.toCharArray();
        int lengths =S.length();
        int i=0;
        int count=0;
        int oldcount=0;

        for(;i<lengths;i++){
            if(chars[i]=='…'){
                count++;
            }else{
                count=0;
            }
            if(oldcount<count){
                oldcount=count;
            }

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