結果

問題 No.1070 Missing a space
ユーザー tentententen
提出日時 2020-11-09 20:15:19
言語 Java21
(openjdk 21)
結果
AC  
実行時間 115 ms / 1,000 ms
コード長 326 bytes
コンパイル時間 1,828 ms
コンパイル使用メモリ 71,196 KB
実行使用メモリ 56,512 KB
最終ジャッジ日時 2023-09-29 22:14:41
合計ジャッジ時間 3,736 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
56,512 KB
testcase_01 AC 113 ms
56,316 KB
testcase_02 AC 113 ms
55,504 KB
testcase_03 AC 111 ms
55,576 KB
testcase_04 AC 112 ms
56,204 KB
testcase_05 AC 114 ms
56,176 KB
testcase_06 AC 113 ms
55,900 KB
testcase_07 AC 113 ms
56,328 KB
testcase_08 AC 113 ms
56,248 KB
testcase_09 AC 115 ms
56,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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