結果

問題 No.207 世界のなんとか
ユーザー oldlevinoldlevin
提出日時 2020-02-21 05:45:09
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 25 ms / 5,000 ms
コード長 927 bytes
コンパイル時間 793 ms
コンパイル使用メモリ 110,412 KB
実行使用メモリ 26,148 KB
最終ジャッジ日時 2024-04-17 06:42:21
合計ジャッジ時間 1,935 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
23,772 KB
testcase_01 AC 23 ms
24,160 KB
testcase_02 AC 24 ms
26,148 KB
testcase_03 AC 25 ms
24,160 KB
testcase_04 AC 24 ms
24,024 KB
testcase_05 AC 23 ms
24,032 KB
testcase_06 AC 25 ms
24,032 KB
testcase_07 AC 24 ms
23,904 KB
testcase_08 AC 23 ms
26,136 KB
testcase_09 AC 23 ms
24,156 KB
testcase_10 AC 23 ms
24,032 KB
testcase_11 AC 24 ms
24,104 KB
testcase_12 AC 25 ms
26,016 KB
testcase_13 AC 25 ms
24,288 KB
testcase_14 AC 25 ms
26,008 KB
testcase_15 AC 24 ms
21,812 KB
testcase_16 AC 24 ms
24,032 KB
testcase_17 AC 24 ms
26,112 KB
testcase_18 AC 24 ms
24,236 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