我写了这么一段代码,认为可以做三个数字的排序,但是为什么运行后没结果。请人帮忙给我看看,可能有地方写错了,我自己没看出来usingSystem;usingSystem.Collections.Generic;usingS...
我写了这么一段代码,认为可以做三个数字的排序,但是为什么运行后没结果。请人帮忙给我看看,可能有地方写错了,我自己没看出来
using System;
using System.Collections.Generic;
using System.Text;
namespace shuzipaixu
{
class Program
{
static void Main(string[] args)
{
int a = Convert.ToInt32(Console.ReadLine());
int b = Convert.ToInt32(Console.ReadLine());
int c = Convert.ToInt32(Console.ReadLine());
// Console.WriteLine("{0}{1}{2}",a,b,c);
if(a>b)
{
if (b > c)
{
Console.WriteLine("{0}{1}{2}",a,b,c);
}
}
else if(a>c)
{
if(c>b)
{
Console.WriteLine("{0}{1}{2}",a,c,b);
}
}
else if(b>c)
{
if(c>a)
{
Console.WriteLine("{0}{1}{2}",b,c,a);
}
}
}
}
}
展开