結果

問題 No.656 ゴルフ
コンテスト
ユーザー kazuki794
提出日時 2018-03-04 14:24:12
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
RE  
実行時間 -
コード長 331 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 172 ms
コンパイル使用メモリ 38,976 KB
最終ジャッジ日時 2026-02-22 00:49:17
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 4
other RE * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
#include <stdlib.h>

int main(void) {
  char S[] = "";
  int i_S = 0;

  int i = 0;

  int tmp = 0;
  int sum = 0;

  scanf("%s",S);

  i_S = atoi(S);

  tmp = i_S;
  for(i=0;i<9;i++){
    if(tmp % 10 == 0)
      sum += 10;
    else
      sum += tmp % 10;
    tmp /= 10;
  }

  printf("%d\n",sum);

  return 0;
}
0