結果

問題 No.207 世界のなんとか
ユーザー ReERishun
提出日時 2019-06-05 17:30:14
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 694 bytes
コンパイル時間 1,047 ms
コンパイル使用メモリ 31,104 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-22 03:37:20
合計ジャッジ時間 1,818 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <math.h>

int main() {

    //宣言
    int start=0;
    int end=0;
    int num[100000];
    int cnt=0;

    for(int i=0;i<100000;i++)
        num[i]=0;

    //入力受付
    scanf("%d %d",&start,&end);

    //判定
    for(int i=start;i<=end;i++){
        if(i%3==0){
            num[cnt]=i;
            cnt++;
            continue;
        }else{
            for(int j=0;(int)(i/pow(10,j))>0;j++){
                if((int)(i/pow(10,j))%10==3){
                    num[cnt]=i;
                    cnt++;
                    break;
                }
            }
        }
    }

    for(int i=0;i<cnt;i++){
        printf("%d\n",num[i]);
    }

    return 0;
}
0