我错哪了?求大神解答 我是新手#include "stdafx.h"int max(int a, int b){int temp;if (a > b)temp=a;elsetemp=b;returntemp;}int main(int argc, char* argv[]){ int x, y;scanf("%d %d", &x, &y);int result=max(x, y);printf("max=%d
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 16:27:11
我错哪了?求大神解答 我是新手#include "stdafx.h"int max(int a, int b){int temp;if (a > b)temp=a;elsetemp=b;returntemp;}int main(int argc, char* argv[]){ int x, y;scanf("%d %d", &x, &y);int result=max(x, y);printf("max=%d
我错哪了?求大神解答 我是新手
#include "stdafx.h"
int max(int a, int b)
{
int temp;
if (a > b)
temp=a;
else
temp=b;
returntemp;
}
int main(int argc, char* argv[])
{
int x, y;
scanf("%d %d", &x, &y);
int result=max(x, y);
printf("max=%d\n",result);
return 1;
}
我错哪了?求大神解答 我是新手#include "stdafx.h"int max(int a, int b){int temp;if (a > b)temp=a;elsetemp=b;returntemp;}int main(int argc, char* argv[]){ int x, y;scanf("%d %d", &x, &y);int result=max(x, y);printf("max=%d
#include //加头文件
int max(int a,int b)
{
\x05int temp;
\x05if (a > b)
\x05\x05temp=a;
\x05else
\x05\x05temp=b;
\x05\x05return\x05temp;
}
int main(int argc,char* argv[])
{
int x,y;
int result;//变量尽量先定义再使用
\x05\x05scanf("%d %d",&x,&y);
result=max(x,y);
\x05printf("max=%d\n",result);
}