結果

問題 No.682 Average
ユーザー isimiya
提出日時 2018-05-23 20:54:11
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 424 bytes
コンパイル時間 912 ms
コンパイル使用メモリ 110,520 KB
実行使用メモリ 18,304 KB
最終ジャッジ日時 2024-06-28 16:24:26
合計ジャッジ時間 1,722 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

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