提出 #3837696
ソースコード 拡げる
#include <cstdio>
int main() {
char str[10];
scanf("%s", str);
int ans = 0;
for (char *p = str; *p; p++) if (*p == '2') ++ans;
printf("%d\n", ans);
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | A - 12/22 |
| ユーザ | Pepcy_Ch |
| 言語 | C++14 (GCC 5.4.1) |
| 得点 | 100 |
| コード長 | 201 Byte |
| 結果 | AC |
| 実行時間 | 1 ms |
| メモリ | 128 KiB |
コンパイルエラー
./Main.cpp: In function ‘int main()’:
./Main.cpp:5:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%s", str);
^
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 100 / 100 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | sample1.txt, sample2.txt, sample3.txt |
| All | sample1.txt, sample2.txt, sample3.txt, 1.txt, 2.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, sample1.txt, sample2.txt, sample3.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 1.txt | AC | 0 ms | 128 KiB |
| 2.txt | AC | 1 ms | 128 KiB |
| 3.txt | AC | 1 ms | 128 KiB |
| 4.txt | AC | 1 ms | 128 KiB |
| 5.txt | AC | 1 ms | 128 KiB |
| 6.txt | AC | 1 ms | 128 KiB |
| 7.txt | AC | 1 ms | 128 KiB |
| sample1.txt | AC | 0 ms | 128 KiB |
| sample2.txt | AC | 0 ms | 128 KiB |
| sample3.txt | AC | 0 ms | 128 KiB |