結果

問題 No.207 世界のなんとか
ユーザー projectappbird
提出日時 2019-07-25 15:22:44
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 417 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 27,776 KB
最終ジャッジ日時 2025-01-07 07:29:24
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |     scanf("%ld %ld",&a,&b);
      |     ~~~~~^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
int main(){
    unsigned long a,b;
    char numAsStr[11];
    scanf("%ld %ld",&a,&b);
    for (;a<=b;a++){
        if (!(a%3) || [&]()->bool{
            sprintf(numAsStr,"%ld",a);
            for(const char& chara:numAsStr){
              if (chara == '3') return true;
              if (chara == '\0') break;
            }
            return false;
        }())printf("%ld\n",a);
        
    }
}
0