首页 > 其他 > 详细

比较两个数的大小

时间:2015-10-16 23:21:54      阅读:394      评论:0      收藏:0      [点我收藏+]

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

namespace 数字大小比较
{
class Program
{
static void Main(string[] args)
{
Console.Write("请输入第一个数字:");
string a = Console.ReadLine();
int c = Convert.ToInt32(a);
Console.Write("请输入第二个数字:");
string b = Console.ReadLine();
int d = Convert.ToInt32(b );
int int_q;
int_q = (c > d) ? c : d;
Console.WriteLine("两个数字中最大的数字为:{0}", int_q);
Console.ReadLine();
}
}
}

比较两个数的大小

原文:http://www.cnblogs.com/shutiaogege/p/4886528.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!