結果

問題 No.671 1000000007
ユーザー asahi32942398asahi32942398
提出日時 2018-04-28 14:34:27
言語 Java
(openjdk 23)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 449 bytes
コンパイル時間 2,996 ms
コンパイル使用メモリ 75,148 KB
実行使用メモリ 41,188 KB
最終ジャッジ日時 2024-06-27 23:18:28
合計ジャッジ時間 4,140 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        char[] carr = s.toCharArray();
        int count = 0;
        int answer;
        for(char c:carr){
            if(c=='0')
            count++;
        }
        if(count<8)
        answer = 8-count;
        else
        answer = count-8;
        System.out.println(answer);
    }
}
0