2个回答
展开全部
C#
//读入两个参数
ConsoleKeyInfo a = Console.ReadKey();
ConsoleKeyInfo b = Console.ReadKey();
//如果a的值大于b,输出ab,否则输出ba
if(a.Key>=b.Key)
{
Console.WriteLine(a.Key.toString()+","+b.Key.toString());
}else{
Console.WriteLine(b.Key.toString()+","+a.Key.toString());
}
//读入两个参数
ConsoleKeyInfo a = Console.ReadKey();
ConsoleKeyInfo b = Console.ReadKey();
//如果a的值大于b,输出ab,否则输出ba
if(a.Key>=b.Key)
{
Console.WriteLine(a.Key.toString()+","+b.Key.toString());
}else{
Console.WriteLine(b.Key.toString()+","+a.Key.toString());
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询