void main() { int a,b,c; scanf("Please enter two number %d,%
来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/07/14 04:42:01
void main() { int a,b,c; scanf("Please enter two number %d,%d",&a,&b); c=max(a,b); printf("The max
main()
{ int a,b,c;
scanf("Please enter two number %d,%d",&a,&b);
c=max(a,b);
printf("The max number is %d\n",c);
}
int max(int x,int y)
{ int z;
if(x>y) z=x;
else z=y;
return(z);
}
出错提示是这样的
undefined symbol '_main' in module COS
我只想有人给解释一下,我的错在哪了?如何修改呀?
main()
{ int a,b,c;
scanf("Please enter two number %d,%d",&a,&b);
c=max(a,b);
printf("The max number is %d\n",c);
}
int max(int x,int y)
{ int z;
if(x>y) z=x;
else z=y;
return(z);
}
出错提示是这样的
undefined symbol '_main' in module COS
我只想有人给解释一下,我的错在哪了?如何修改呀?
![void main() { int a,b,c; scanf(](/uploads/image/z/6535631-47-1.jpg?t=void+main%28%29+%7B+int+a%2Cb%2Cc%3B+scanf%28%22Please+enter+two+number+%25d%2C%25)
这个错误的原因在于,你在使用max函数时没有对他进行申明,换句话说,main函数使用他时,找不到他,你可以在main函数前先对其进行申明,再使用,实现可以放在main函数后面,如下:
#include
int max(int x, int y);
void main()
{ int a,b,c;
scanf("Please enter two number %d,%d",&a,&b);
c=max(a,b);
printf("The max number is %d\n",c);
}
int max(int x,int y)
{ int z;
if(x>y) z=x;
else z=y;
return(z);
}
也可以像楼上那样直接把max函数的申明和实现都放在main函数的前面.
#include
int max(int x, int y);
void main()
{ int a,b,c;
scanf("Please enter two number %d,%d",&a,&b);
c=max(a,b);
printf("The max number is %d\n",c);
}
int max(int x,int y)
{ int z;
if(x>y) z=x;
else z=y;
return(z);
}
也可以像楼上那样直接把max函数的申明和实现都放在main函数的前面.
void main() { int a,b,c; scanf("Please enter two number %d,%
void main() { int a,b; printf("enter a:"); scanf("a=%d",&a);
# include void main() {int a,b,c,t; scanf("%d%d%d",&a,&b,&c)
#include void main () { int x,y,z,a,b,c,d,g,f; scanf("%d+%d"
c语言ab比较大小#include "stdio.h"void main(){int a,b;scanf("%d",&a
void main() { int a,b,c; printf("please enter 3 numbers:");
#include void main(){int a,b;scanf("%d %d" ,a,b);printf("%d
main() { int number; printf("input a number:\n"); scanf("%d"
# include void main( ) { int a,b,c,sum; float aver; scanf("%
#includevoid main(){int max(int x,int y);int a,b,c;scanf("%d
#include #include void main() { float a,b,c,d; scanf("%d,%d,
#include int main() { int a,b,c; scanf("%d,%d",&a,&b); print