vc6.0++出错,找不到错误,请你们看看哪里错了啊!
#include<stdio.h>intmain(){printf("输入三个整数,计算出它们的最小值\n");inta,b,c;scanf("%d%d%d",&a,&b...
#include<stdio.h>
int main(){
printf("输入三个整数,计算出它们的最小值\n");
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if (a<b&&a==b){
if(a<c&&a==c)
printf("最小值是%d\n",a);
else
printf("最小值是%d\n",c);
}
else {
if (b<c&&b==c)
printf("最小值是%d\n",b);
else
printf("最小值是%d\n",c);
}
system("pause");
}
//编译错误是
--------------------Configuration: 1.5 - Win32 Debug--------------------
Compiling...
1.5.c
D:\Learning\c program language\src\1.5.c(4) : error C2143: syntax error : missing ';' before 'type'
D:\Learning\c program language\src\1.5.c(5) : error C2065: 'a' : undeclared identifier
D:\Learning\c program language\src\1.5.c(5) : error C2065: 'b' : undeclared identifier
D:\Learning\c program language\src\1.5.c(5) : error C2065: 'c' : undeclared identifier
D:\Learning\c program language\src\1.5.c(19) : warning C4013: 'system' undefined; assuming extern returning int
执行 cl.exe 时出错.
1.5.obj - 1 error(s), 0 warning(s) 展开
int main(){
printf("输入三个整数,计算出它们的最小值\n");
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if (a<b&&a==b){
if(a<c&&a==c)
printf("最小值是%d\n",a);
else
printf("最小值是%d\n",c);
}
else {
if (b<c&&b==c)
printf("最小值是%d\n",b);
else
printf("最小值是%d\n",c);
}
system("pause");
}
//编译错误是
--------------------Configuration: 1.5 - Win32 Debug--------------------
Compiling...
1.5.c
D:\Learning\c program language\src\1.5.c(4) : error C2143: syntax error : missing ';' before 'type'
D:\Learning\c program language\src\1.5.c(5) : error C2065: 'a' : undeclared identifier
D:\Learning\c program language\src\1.5.c(5) : error C2065: 'b' : undeclared identifier
D:\Learning\c program language\src\1.5.c(5) : error C2065: 'c' : undeclared identifier
D:\Learning\c program language\src\1.5.c(19) : warning C4013: 'system' undefined; assuming extern returning int
执行 cl.exe 时出错.
1.5.obj - 1 error(s), 0 warning(s) 展开
1个回答
展开全部
system函数属于stdlib.h
应该这样写
#include<stdio.h>
#include<stdlib.h>
int main()
{
printf("输入三个整数,计算出它们的最小值\n");
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if (a<b&&a==b){
if(a<c&&a==c)
printf("最小值是%d\n",a);
else
printf("最小值是%d\n",c);
}
else {
if (b<c&&b==c)
printf("最小值是%d\n",b);
else
printf("最小值是%d\n",c);
}
system("pause");
}
追问
我改过了还是同样的错
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询