結果
| 問題 | No.207 世界のなんとか |
| コンテスト | |
| ユーザー |
A63295
|
| 提出日時 | 2015-12-17 21:30:28 |
| 言語 | C90 (gcc 12.4.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 228 bytes |
| 記録 | |
| コンパイル時間 | 135 ms |
| コンパイル使用メモリ | 28,616 KB |
| 最終ジャッジ日時 | 2026-02-23 20:08:49 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 17 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:25: warning: incompatible implicit declaration of built-in function ‘strchr’ [-Wbuiltin-declaration-mismatch]
8 | if( a % 3 == 0 || strchr(str, '3') != NULL)
| ^~~~~~
main.c:2:1: note: include ‘<string.h>’ or provide a declaration of ‘strchr’
1 | #include <stdio.h>
+++ |+#include <string.h>
2 | int main(void){
main.c:5:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d%d",&a,&b);
| ^~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void){
int a, b, c;
char str[16];
scanf("%d%d",&a,&b);
for( a; a <= b; a++){
sprintf(str, "%d", a);
if( a % 3 == 0 || strchr(str, '3') != NULL)
printf("%d", a);
}
return 0;
}
A63295