結果

問題 No.682 Average
ユーザー isimiyaisimiya
提出日時 2018-05-23 20:54:11
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 424 bytes
コンパイル時間 802 ms
コンパイル使用メモリ 63,640 KB
実行使用メモリ 22,928 KB
最終ジャッジ日時 2023-09-11 01:54:21
合計ジャッジ時間 2,265 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
22,928 KB
testcase_01 AC 57 ms
20,664 KB
testcase_02 AC 58 ms
22,848 KB
testcase_03 AC 57 ms
20,796 KB
testcase_04 AC 57 ms
18,632 KB
testcase_05 AC 57 ms
20,692 KB
testcase_06 AC 59 ms
22,804 KB
testcase_07 AC 58 ms
22,740 KB
testcase_08 AC 57 ms
20,624 KB
testcase_09 AC 56 ms
20,620 KB
testcase_10 AC 57 ms
22,676 KB
testcase_11 AC 58 ms
22,888 KB
testcase_12 AC 58 ms
22,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
public class Classmiya
{
	static void Main()
	{
		string stdin = Console.ReadLine();
		string[] text = stdin.Split(' ');
		int A = int.Parse(text[0]);
		int B = int.Parse(text[1]);
		int count = 0;
		double average = 0.0;

		for (int i = A ; i <= B; i++){
			average = (A + B + i) / 3.0;

			if(average == Convert.ToDouble(Convert.ToInt32(average))){
				count += 1;
			}
		}
		Console.WriteLine(count);
	}
}

0