結果
| 問題 |
No.9001 標準入出力の練習問題(テスト用)
|
| ユーザー |
UoMJ3E5VRmVwkKz
|
| 提出日時 | 2018-01-31 16:08:50 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 265 bytes |
| コンパイル時間 | 294 ms |
| コンパイル使用メモリ | 24,064 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-29 23:48:08 |
| 合計ジャッジ時間 | 680 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 2 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:17: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘char (*)[10]’ [-Wformat=]
12 | scanf("%s", &s,10);
| ~^ ~~
| | |
| | char (*)[10]
| char*
main.cpp:12:15: warning: too many arguments for format [-Wformat-extra-args]
12 | scanf("%s", &s,10);
| ^~~~
main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d", &a);
| ~~~~~^~~~~~~~~~
main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%d", &b);
| ~~~~~^~~~~~~~~~
main.cpp:12:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%s", &s,10);
| ~~~~~^~~~~~~~~~~~~
main.cpp:20:15: warning: ignoring return value of ‘int system(const char*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
20 | system("pause");
| ~~~~~~^~~~~~~~~
ソースコード
#include<stdio.h>
#include<stdlib.h>
int main() {
int a = 0;
int b = 0;
char s[10];
scanf("%d", &a);
scanf("%d", &b);
scanf("%s", &s,10);
printf("%d", a + b);
for (int i = 0; i < 10; i++) {
printf("%c", s[i]);
}
system("pause");
return 0;
}
UoMJ3E5VRmVwkKz