結果
| 問題 |
No.289 数字を全て足そう
|
| コンテスト | |
| ユーザー |
ゆーたろ
|
| 提出日時 | 2016-11-18 18:52:20 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 254 bytes |
| コンパイル時間 | 153 ms |
| コンパイル使用メモリ | 20,864 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-26 06:06:17 |
| 合計ジャッジ時間 | 4,721 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 21 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:11:20: warning: implicit declaration of function ‘atoi’ [-Wimplicit-function-declaration]
11 | if(atoi(s[i])>0 || atoi(s[i])<10){
| ^~~~
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%s", s);
| ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
int main(void) {
int sum=0, i, len;
char s[10000];
scanf("%s", s);
len = strlen(s);
for(i=0; i<len; i++){
if(atoi(s[i])>0 || atoi(s[i])<10){
sum += atoi(s[i]);
}
}
printf("%d", sum);
return 0;
}
ゆーたろ