main()
{
consle.writeline("输入三个数");
int a,b,c;
int result;
string str;
str = consle.readline();
a = str.int32.parse();
str = consle.readline();
b = str.int32.parse();
str = consle.readline();
c = str.int32.parse();
result = fun(a,b,c);
}
int fun(int a ,int b,int c)
{
return a>(b>c?b:c)?a:(b>c?b:c);
}
就这么个意思,我电脑没装vs ,consle可能写的不对,你用编辑器的时候会给提示的
using System;
namespace ConsoleMatrix
{
class Program
{
static void Main(string[] args)
{
int x, max = int.MinValue;
Console.WriteLine("请输入3个数:");
for (int i = 0; i < 3; i++)
{
x = int.Parse(Console.ReadLine());
if (x > max) max = x;
}
Console.WriteLine("最大数为:{0}", max);
}
}
}