結果

問題 No.207 世界のなんとか
ユーザー oldlevinoldlevin
提出日時 2020-02-21 05:45:09
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 62 ms / 5,000 ms
コード長 927 bytes
コンパイル時間 2,063 ms
コンパイル使用メモリ 103,768 KB
実行使用メモリ 22,932 KB
最終ジャッジ日時 2023-07-30 04:50:14
合計ジャッジ時間 4,638 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
22,892 KB
testcase_01 AC 61 ms
20,856 KB
testcase_02 AC 61 ms
20,780 KB
testcase_03 AC 62 ms
20,760 KB
testcase_04 AC 61 ms
20,876 KB
testcase_05 AC 61 ms
20,844 KB
testcase_06 AC 61 ms
22,880 KB
testcase_07 AC 61 ms
22,796 KB
testcase_08 AC 62 ms
22,932 KB
testcase_09 AC 62 ms
22,804 KB
testcase_10 AC 62 ms
20,844 KB
testcase_11 AC 61 ms
20,736 KB
testcase_12 AC 62 ms
18,800 KB
testcase_13 AC 61 ms
20,756 KB
testcase_14 AC 61 ms
20,860 KB
testcase_15 AC 61 ms
20,760 KB
testcase_16 AC 60 ms
20,844 KB
testcase_17 AC 58 ms
20,748 KB
testcase_18 AC 60 ms
22,792 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;

public class hello{
    public static void Main(){

        //yukicoder 
        //A以上B以下の整数のうち、3の倍数および3の付く数を、小さい順に出力
        
        var s = ReadLine().Trim().Split(' ');//.Select(int.Parse).ToArray();
        var a = s[0];  //1≤A≤2,000,000,000
        var b = s[1];
        var na = long.Parse(a);
        var nb = long.Parse(b);
        
        for(long i =na ; i<=nb;i++){
            //3の倍数
            if(i%3==0 ) {
                WriteLine(i); 
                continue;
            }
            
            //char配列に見立て、文字'3'が含まれるか判定
            var str = Convert.ToString(i);
            if(str.Contains('3')){
                WriteLine(i); 
                continue;
            }
        }

    }
}//end hello
0