|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
int max(int a,int b);
main()
[
int x,y,z;
int max(int a.int b);
printf("input two numbers:\n");
scanf("%d%d",&x,&y);
z=max(x,y);
printf("maxmum=%c",z);
]
int max(int a,int b)
[
if(a>b)return a:else return b;
}
本帖最后由 jackz007 于 2022-9-8 17:17 编辑
- #include <stdio.h>
- int max(int a , int b)
- {
- return (a > b) ? a : b ;
- }
- int main(void)
- {
- int x , y , z ;
- printf("input two numbers : ") ;
- scanf("%d%d" , & x , & y) ;
- z = max(x , y) ;
- printf("maxmum = %d\n" , z) ;
- }
复制代码
编译、运行实况:
- D:\[00.Exerciese.2022]\C>g++ -o x x.c
- D:\[00.Exerciese.2022]\C>x
- input two numbers : 3 8
- maxmum = 8
- D:\[00.Exerciese.2022]\C>
复制代码
|
|