結果
| 問題 | No.289 数字を全て足そう |
| コンテスト | |
| ユーザー |
funakoshi
|
| 提出日時 | 2019-08-19 17:48:33 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 428 bytes |
| 記録 | |
| コンパイル時間 | 1,281 ms |
| コンパイル使用メモリ | 28,928 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-04 16:54:31 |
| 合計ジャッジ時間 | 1,374 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
int main(void)
{
char str[11000]="";
char num[]={'1','2','3','4','5','6','7','8','9'};
int total=0;
scanf("%s",str);
for(int i=0;i<strlen(str);i++)
{
for(int j=0;j<9;j++)
{
if(str[i]==num[j])
{
total+=num[j]-'0';
}
}
}
printf("%d",total);
}
funakoshi