結果
| 問題 |
No.207 世界のなんとか
|
| コンテスト | |
| ユーザー |
jolly_gliscor
|
| 提出日時 | 2018-02-19 21:10:48 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 412 bytes |
| コンパイル時間 | 469 ms |
| コンパイル使用メモリ | 64,572 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-16 01:03:55 |
| 合計ジャッジ時間 | 1,183 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:22:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
22 | scanf("%d",&a);
| ~~~~~^~~~~~~~~
main.cpp:23:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
23 | scanf("%d",&b);
| ~~~~~^~~~~~~~~
ソースコード
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <string>
#include <iostream>
void PrintAll3(int a, int b)
{
for(int i=a; i<=b; i++){
if( i % 3 == 0 ){
printf("%d\n",i);
}else if(std::to_string(i).find("3") != std::string::npos){
printf("%d\n",i);
}
}
}
int main(void)
{
int a,b;
scanf("%d",&a);
scanf("%d",&b);
PrintAll3(a,b);
return 0;
}
jolly_gliscor