
2个回答
展开全部
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可能写的不对,你用编辑器的时候会给提示的
{
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);
}
}
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询