求帮忙看一下这个c语言程序的问题
(我是新手,勿笑)#include<stdio.h>intmain(void){intmax(intx,inty);inta,b,c;scanf("%d,%d",&a,&...
(我是新手,勿笑)
#include<stdio.h>
int main(void)
{
int max(int x,int y);
int a,b,c;
scanf("%d,%d",&a,&b);
c=max(a,b);
printf("max=%d\n",c);
return 0;
}
int max(int x,int y);
{ int z;
if (x>y)z = x;
else z=y;
return(z);
}
vs显示
警告 1 warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. g:\1xuan\1\1\1.c 6 1 1
错误 2 error C2449: 在文件范围内找到“{”(是否缺少函数头?) g:\1xuan\1\1\1.c 12 1 1
错误 3 error C2059: 语法错误:“}” g:\1xuan\1\1\1.c 16 1 1
4 IntelliSense: 应输入声明 g:\1xuan\1\1\1.c 12 1 1
请问该如何改正 展开
#include<stdio.h>
int main(void)
{
int max(int x,int y);
int a,b,c;
scanf("%d,%d",&a,&b);
c=max(a,b);
printf("max=%d\n",c);
return 0;
}
int max(int x,int y);
{ int z;
if (x>y)z = x;
else z=y;
return(z);
}
vs显示
警告 1 warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. g:\1xuan\1\1\1.c 6 1 1
错误 2 error C2449: 在文件范围内找到“{”(是否缺少函数头?) g:\1xuan\1\1\1.c 12 1 1
错误 3 error C2059: 语法错误:“}” g:\1xuan\1\1\1.c 16 1 1
4 IntelliSense: 应输入声明 g:\1xuan\1\1\1.c 12 1 1
请问该如何改正 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询