我的代码中存在问题,即使我将其指定为双精度数据类型,平均值也是整数。可能是什么问题呢?
using System;
using static System.Console;
using System.Linq;
class TemperaturesComparison
{
static void Main()
{
int[] temp = new int[5];
int i = 0;
while (i < 5)
{
int eachTemp = int.Parse(ReadLine());
if (eachTemp < -30 || eachTemp > 130) continue; //skips
temp[i] = eachTemp;
i++;
}
if (temp[0] < temp[1] && temp[1] < temp[2] && temp[2] < temp[3] && temp[3] < temp[4]) WriteLine("Getting warmer");
else if (temp[0] > temp[1] && temp[1] > temp[2] && temp[2] > temp[3] && …Run Code Online (Sandbox Code Playgroud) c# ×1