程序有点问题,最后输出的值总是0,请帮我修改一下!
using System;using System.Windows.Forms;
public class bijiaodaxiao
{
public float a;
public float b;
public float c;
public bijiaodaxiao()
{
string output = "请输入三个浮点数:";
Console.WriteLine(output);
float a = float.Parse(Console.ReadLine());
float b = float.Parse(Console.ReadLine());
float c = float.Parse(Console.ReadLine());
}
public float minimum3(out float x, out float y, out float z)
{
x = a;
y = b;
z = c;
if (x <= y)
{
if (x <= z)
return x;
else
return z;
}
else
{
if (y <= z)
return y;
else
return z;
}
}
}
public class ywf
{
static void Main()
{
bijiaodaxiao abijiaodaxiao = new bijiaodaxiao();
float x1;
float y1;
float z1;
string output = "最小浮点数为:";
abijiaodaxiao.minimum3(out x1, out y1, out z1);
Console.WriteLine(output);
}
}