結果
| 問題 | No.432 占い(Easy) |
| コンテスト | |
| ユーザー |
sasa
|
| 提出日時 | 2025-03-19 18:00:12 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 263 bytes |
| コンパイル時間 | 377 ms |
| コンパイル使用メモリ | 28,032 KB |
| 実行使用メモリ | 7,328 KB |
| 最終ジャッジ日時 | 2025-03-19 18:00:13 |
| 合計ジャッジ時間 | 1,411 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 22 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:25: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘char*’ [-Wformat=]
10 | scanf("%d",fortune);
| ~^ ~~~~~~~
| | |
| | char*
| int*
| %hhd
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d",&val);
| ~~~~~^~~~~~~~~~~
main.cpp:10:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%d",fortune);
| ~~~~~^~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
int main(void){
int val = 0;
scanf("%d",&val);
char fortune[10];
for(int i = 0;i < val;i ++){
scanf("%d",fortune);
int len = strlen(fortune);
if(len == 1){
printf("%s",fortune);
return 0;
}
}
}
sasa