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,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);
}
比较一下吧!呵呵~~~~~~~~~~~~~~~~~~~~~``
#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编辑过]