int a=Int32.Parse(FirstOperand.Text);
int b=Int32.Parse(SecondOperand.Text);
int c=Int32.Parse(TirchdOperand.Text);
//以下可在Button控件下输入(双击Button)
if(a<=b)
{if(b<=c)Console.Write("最大值为"+c);
else Console.Write("最大值为"+b);
}
else
{ if(a<=c)Console.Write("最大值为"+c);
else Console.Write("最大值为"+a);
}
FirstOperand;SecondOperand;TirchdOperand为自建的TextBox控件
我没运行试试吧……
赚钱鲁过
int max(int a,int b,int c){
(a>b)?b=a:b=b;
(b>c)?return b:return c;
}