sqlserver教程网

当前位置: 主页 > 编程语言 > c# >

if控制流程语句使用

时间:2017-09-16 13:30来源:www.sqlserver.net.cn 作者:admin 点击:
using System; class Program{ static void Main(string[] args) { Console.WriteLine(enter a); int a = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(enter b); int b = Convert.ToInt32(Console.ReadLine()); if (a == b) { Console.WriteLine




using System;
 
 
class Program{
 
static void Main(string[] args)
{
    Console.WriteLine("enter a");
    int a = Convert.ToInt32(Console.ReadLine());
    Console.WriteLine("enter b");
    int b = Convert.ToInt32(Console.ReadLine());
 
    if (a == b)
    {
        Console.WriteLine("a equal b");
    }
    else
    {
        if (a > b)
        {
            Console.WriteLine("max is a");
        }
 
        else
        {
            Console.WriteLine("max is a");
        }
    
    }
 
    Console.ReadLine();
 
 
 
 
}
}
(责任编辑:admin)
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
验证码: 点击我更换图片