結果
| 問題 | No.9011 数字を全て足そう(数字だけ) |
| ユーザー |
tagufartv
|
| 提出日時 | 2020-09-28 22:19:57 |
| 言語 | C(gnu17) (gcc 15.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 214 bytes |
| 記録 | |
| コンパイル時間 | 93 ms |
| コンパイル使用メモリ | 27,232 KB |
| 最終ジャッジ日時 | 2026-02-22 06:09:09 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c: In function 'main':
main.c:7:11: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
7 | int l=strlen(s);
| ^~~~~~
main.c:3:1: note: include '<string.h>' or provide a declaration of 'strlen'
2 | #include<stdlib.h>
+++ |+#include <string.h>
3 |
main.c:7:11: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
7 | int l=strlen(s);
| ^~~~~~
main.c:7:11: note: include '<string.h>' or provide a declaration of 'strlen'
ソースコード
#include<stdio.h>
#include<stdlib.h>
int main(void){
char s[101];
scanf("%s",s);
int l=strlen(s);
int c=0;
for(int i=0;i<l;i++){
c+=s[i]-'0';
}
printf("%d\n",c);
return 0;
}
tagufartv