結果

問題 No.207 世界のなんとか
コンテスト
ユーザー nanatutmc
提出日時 2019-09-12 01:14:13
言語 C11(gcc12 gnu拡張)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=gnu11 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 529 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 138 ms
コンパイル使用メモリ 31,836 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-03-08 16:20:58
合計ジャッジ時間 551 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:3:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    3 | main() {
      | ^~~~
main.c: In function ‘main’:
main.c:20:22: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=]
   20 |             printf("%d\n", i);
      |                     ~^     ~
      |                      |     |
      |                      int   long int
      |                     %ld
main.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |     scanf("%ld %ld", &A, &B);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include <stdio.h>

main() {
    long A, B;
    
    scanf("%ld %ld", &A, &B);
    
    for (long i=A; i<=B; i++) {
        if ((i%3 == 0) ||
            (i%10 == 3) ||
            ((i/10)%10 == 3) ||
            ((i/100)%10 == 3) ||
            ((i/1000)%10 == 3) ||
            ((i/10000)%10 == 3) ||
            ((i/100000)%10 == 3) ||
            ((i/1000000)%10 == 3) ||
            ((i/10000000)%10 == 3) ||
            ((i/100000000)%10 == 3) ||
            ((i/1000000000)%10 == 3))
            printf("%d\n", i);
    }
}
0