课后练习1.

1.三个数中选最大值

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication18
{
class Program
{
static void Main(string[] args)
{
Console.Write("");
int a = int.Parse(Console.ReadLine());

Console.Write("");
int b = int.Parse(Console.ReadLine());

Console.Write("");
int c = int.Parse(Console.ReadLine());

if (a > b && b > c)
{
Console.WriteLine("三个数中最大的数为: +a");
}
if (a < b && b < c)
{
Console.WriteLine("三个数中最大的数为: +c");
}
if (a < b && b > c)
{
Console.WriteLine("三个数中最大的数为: +b");
}

Console.ReadLine();
}

}
}

 

posted @ 2015-08-01 20:44  MySpace2015  阅读(106)  评论(0编辑  收藏  举报