結果
問題 | No.207 世界のなんとか |
ユーザー |
![]() |
提出日時 | 2016-02-26 21:19:14 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 430 bytes |
コンパイル時間 | 105 ms |
コンパイル使用メモリ | 21,504 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-22 14:02:20 |
合計ジャッジ時間 | 917 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:8:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%ld",&a); | ^~~~~~~~~~~~~~~ main.c:9:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%ld",&b); | ^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <string.h> int main(void) { long int a,b; long int i; char str[100]; int n; scanf("%ld",&a); scanf("%ld",&b); for (i=a; i<=b; i++) { if (i%3==0) { printf("%ld\n",i); } else { sprintf(str, "%ld", i); n=strlen(str); for (int j=0; j<n; j++) { if (str[j]=='3') { printf("%ld\n",i); break; } } } } return 0; }