这段代码有什么错,检查几边,没找到原因
编译时出现一个错误# include <stdio.h>
int main(void)
{
int a,b,c;
int t;
printf("请输入三个整数(中间以空格分隔):");
scanf("%d %d %d", &a, &b, &c);
if (a<b)
{
t=a;
a=b;
b=t;
}
if (a<c)
{
t=a;
a=c;
c=t;
}
if (b<c)
{
t=b;
b=c;
c=t;
}
printf("%d %d %d\n",a,b,c);
return 0;
}
这样写再试试!scanf("%d%d%d",&a,&b,&c);
mingw32-gcc.exe -c "C:\Documents and Settings\Administrator\桌面\c语言\1.c" -o "C:\Documents and Settings\Administrator\桌面\c语言\1.o"
mingw32-g++.exe-o "C:\Documents and Settings\Administrator\桌面\c语言\1.exe" "C:\Documents and Settings\Administrator\桌面\c语言\1.o"
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
用codeblocks自带gcc编译器编译无错
页:
[1]