結果
問題 |
No.207 世界のなんとか
|
ユーザー |
|
提出日時 | 2016-10-20 15:35:53 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 28 ms / 5,000 ms |
コード長 | 680 bytes |
コンパイル時間 | 854 ms |
コンパイル使用メモリ | 103,040 KB |
実行使用メモリ | 18,560 KB |
最終ジャッジ日時 | 2024-11-22 16:25:16 |
合計ジャッジ時間 | 1,956 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; public class Program { static void Main() { string AB = Console.ReadLine(); string A_ = ""; int i = 0; while (AB.Substring(i,1) != " ") { A_ = A_ + AB.Substring(i, 1); i++; } int A = Convert.ToInt32(A_); int B = Convert.ToInt32(AB.Substring(i + 1)); int N = B - A; if (N >= 0 && N <= 100) { for (int d = A; d < B + 1; d++) { string d_ = d.ToString(); if (d % 3 == 0) { Console.WriteLine(d.ToString()); continue; } else if(d_.IndexOf("3") >= 0) { Console.WriteLine(d.ToString()); } } } } }