----------------解决方案--------------------------------------------------------
#include<stdio.h>
int main()
{
int a , b, c, max = 0;
printf( "Enter three number\n" );
scanf( "%d,%d,%d", &a, &b, &c );
if( a>b )
{
if( a>c)
max = a;
else max = c;
}
else if( b>c )
max = b;
else max = c;
printf( "%d", max );
return 0;
}
编译能通过只是说明你的语法是正确的,但并不表示你写出来的程序是你所想要的程序
----------------解决方案--------------------------------------------------------
max=(a>b?a:b)>c?(a>b?a:b):c;
----------------解决方案--------------------------------------------------------
以下是引用nuciewth在2006-9-4 17:30:47的发言:
max=(a>b?a:b)>c?(a>b?a:b):c;
max=(a>b?a:b)>c?(a>b?a:b):c;
干吗弄这种花花的!!
max=a>b?a:b;
max=max>c?max:c;
多好!
----------------解决方案--------------------------------------------------------
----------------解决方案--------------------------------------------------------