結果
問題 |
No.289 数字を全て足そう
|
ユーザー |
![]() |
提出日時 | 2020-03-26 23:35:04 |
言語 | C (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 311 bytes |
コンパイル時間 | 367 ms |
コンパイル使用メモリ | 23,168 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2025-01-02 07:41:30 |
合計ジャッジ時間 | 1,340 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | RE * 21 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:18:12: warning: ‘return’ with a value, in function returning void 18 | return 0; | ^ main.c:3:6: note: declared here 3 | void main(){ | ^~~~
ソースコード
#include <stdio.h> void main(){ char str; int ans = 0; while(1){ str = getchar(); if(str == '\n'){ break; }else if(str >= '0' && str <= '9'){ ans += ( (int)str - (int)'0' ); } } printf("%d",ans); return 0; }