标题:程序有点问题,最后输出的值总是0,请帮我修改一下!
取消只看楼主
杨为丰
Rank: 2
等 级:论坛游民
帖 子:17
专家分:16
注 册:2013-4-10
结帖率:25%
已结贴  问题点数:20 回复次数:0 
程序有点问题,最后输出的值总是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);

    }
}



        
            
   
搜索更多相关主题的帖子: public public 
2013-04-13 11:15



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-404068-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.123672 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved