谁帮我看一下这程序有什么问题?谢谢!

来源:百度知道 编辑:UC知道 时间:2024/09/22 07:17:33
#include"stdio.h"
main()
int a,b,c,d,temp;
scanf("%d%d%d%d",&a,&b,&c,&d);
if(a>b)
{
temp=a;
a=b;
b=temp;
}
if(a>c)
{
temp=a;
a=c;
c=temp;
}
if(a>d)
{
temp=a;
a=d;
d=temp;
}
if(b>c)
{
temp=b;
b=c;
c=temp;
}
if(b>d)
{
temp=b;
b=d;
d=temp;
}
if(c>d)
{
temp=c;
c=d;
d=temp;
}
printf("%d%d%d%d",a,b,c,d);
}

#include"stdio.h"
#include "Stdafx.h" //vc编译的时候要添加
#include "stdio.h" //scanf和pringtf需要调用的头文件
#include"stdlib.h"//最后那个system调用头文件
void main() //建议加上void或者int
{ //这个你缺少了,结尾倒是有,笔误吧。。。
int a,b,c,d,temp;
scanf("%d%d%d%d",&a,&b,&c,&d);
if(a>b)
{
temp=a;
a=b;
b=temp;
}
if(a>c)
{
temp=a;
a=c;
c=temp;
}
if(a>d)
{
temp=a;
a=d;
d=temp;
}
if(b>c)
{
temp=b;
b=c;
c=temp;
}
if(b>d)
{
temp=b;
b=d;
d=temp;
}
if(c>d)
{
temp=c;
c=d;
d=temp;
}
printf("%d%d%d%d",a,b,c,d);
system("pause");
//增加的可以看结果,按任意键结束,不然在dos窗口闪一下就没了
}