标题:c#主函数如何调用
取消只看楼主
kendall
Rank: 1
等 级:新手上路
帖 子:2
专家分:5
注 册:2013-2-9
结帖率:100%
已结贴  问题点数:20 回复次数:0 
c#主函数如何调用
static void Main(string[] args)
        {
            int a, b;
            
            float c;
             a = Convert.ToInt32(Console.ReadLine());
             b = Convert.ToInt32(Console.ReadLine());
             c = divide("c");
            Console.WriteLine(c );
     
        }
float   divide( int a, int b)
        {
            float c=0;
            if (b == 0)
                Console.WriteLine("除数不能为0!");
            else
              c = (float)a / b;
          return c;
        }
自己写起来始终有错,哪位高手能帮忙解决一下啊
搜索更多相关主题的帖子: static void return 如何 
2013-03-12 15:23



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




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

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