結果

問題 No.1070 Missing a space
ユーザー toco8
提出日時 2020-07-01 07:25:51
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 219 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 28,416 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-13 20:48:18
合計ジャッジ時間 674 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main(void)
{
  int i, ans = 0;
  char num[101];

  scanf("%s", num);
  for (i = 0; num[i] != '\0'; i++) {
      if (num[i] == '0') ans--;
  }
  ans += i - 1;
  printf("%d\n", ans);
  return 0;
}
0