結果
問題 |
No.207 世界のなんとか
|
ユーザー |
|
提出日時 | 2017-02-28 14:35:47 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 290 bytes |
コンパイル時間 | 517 ms |
コンパイル使用メモリ | 21,120 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-11 22:56:59 |
合計ジャッジ時間 | 1,155 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 WA * 10 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:9: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long int *’ [-Wformat=] 7 | scanf("%d%d", &A, &B); | ~^ ~~ | | | | int * long int * | %ld main.c:7:11: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘long int *’ [-Wformat=] 7 | scanf("%d%d", &A, &B); | ~^ ~~ | | | | int * long int * | %ld main.c:11:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=] 11 | printf("%d\n",A); /*3の倍数出力*/ | ~^ ~ | | | | int long int | %ld main.c:18:34: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=] 18 | printf("%d\n",A); | ~^ ~ | | | | int long int | %ld main.c:7:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d%d", &A, &B); | ^~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(void) { long A, B; scanf("%d%d", &A, &B); for(A;A<=B;A++){ if(A%3 == 0){ printf("%d\n",A); /*3の倍数出力*/ }else{ long N=1; /*N=桁数*/ while(A>N){ if(((A/N)%10) == 3 )/*3を探す*/ printf("%d\n",A); N=N*10; } } } return 0; }