void main()
int a,b,c,sum;
scanf("%d,%d,%d",&a,&b,&c);
if(a>b&&a>c) sum=a;
else if(b>a&&b>c) sum=b;
else sum=c;
printf(%d\n,sum);
}
怎么运行不起来呢
----------------解决方案--------------------------------------------------------
#include <stdio.h>
main()
{
int a,b,c,sum;
scanf("%d,%d,%d",&a,&b,&c);
if(a>b&&a>c) sum=a;
else if(b>a&&b>c) sum=b;
else sum=c;
printf("%d\n",sum);
}
----------------解决方案--------------------------------------------------------
printf( " " )
[此贴子已经被作者于2006-5-10 15:20:48编辑过]
----------------解决方案--------------------------------------------------------
还有一{
----------------解决方案--------------------------------------------------------
楼主的编程风格有待提高……
----------------解决方案--------------------------------------------------------
对 以上说的很对
努力呀
----------------解决方案--------------------------------------------------------
是这样啊
----------------解决方案--------------------------------------------------------
我给你弄了一下.
#include <stdio.h>
void main()
{
int a,b,c,sum;
scanf("%d%d%d",&a,&b,&c);
if(a>b&&a>c) sum=a;
else if(b>a&&b>c) sum=b;
else sum=c;
printf("%d\n",sum);
}
********************************
并且我自己也写了一个.
#include <stdio.h>
void main()
{
int a,b,c,max;
printf("Enter the three numbers:\n");
scanf("%d%d%d",&a,&b,&c);
max=(a>b)?a:b;
max=(c>max)?c:max;
printf("the max is :%d\n",max);
}
比较一下吧!呵呵~~~~~~~~~~~~~~~~~~~~~``
----------------解决方案--------------------------------------------------------
void main()
{
int a,b,c;
printf("Enter the numbers:\n");
scanf("%d%d%d",&a,&b,&c);
printf("the max is :%d\n",(a>b?a:b)>c?(a>b?a:b):c);
}
----------------解决方案--------------------------------------------------------
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
printf("the max is :%d\n",(atoi(argv[1])>atoi(argv[2])?atoi(argv[1]):atoi(argv[2]))>atoi(argv[3])?(atoi(argv[1])>atoi(argv[2])?atoi(argv[1]):atoi(argv[2])):atoi(argv[3]));
}
L:\>c:
C:\>1.exe 123 34 34
the max is :123
C:\>1.exe 123 34 342323
the max is :342323
C:\>
[此贴子已经被作者于2007-1-12 16:05:42编辑过]
----------------解决方案--------------------------------------------------------