結果

問題 No.207 世界のなんとか
ユーザー shallow
提出日時 2017-08-30 17:49:46
言語 C
(gcc 13.3.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 507 bytes
コンパイル時間 420 ms
コンパイル使用メモリ 25,600 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-24 11:44:50
合計ジャッジ時間 1,452 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 RE * 5
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |   scanf("%lld %lld", &A, &B);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
int main() {
  long long A, B, str_1[100] = {0};
  char str_2[10] = {'\0'};
  int i, j = 0, k;
  scanf("%lld %lld", &A, &B);
  for (i = A; i <= B; i++) {
    str_1[j] = i;
    j++;
  }
  for (i = 0; i < j; i++) {
    if (str_1[i]%3 == 0) {
      printf("%lld\n", str_1[i]);
    } else {
      sprintf(str_2, "%lld", str_1[i]);
      for (k = 0; k < 10; k++) {
        if (str_2[k] == '3') {
          printf("%lld\n", str_1[i]);
          break;
        }
      }
    }
  }
  return 0;
}
0