加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

c语言:用函数找大数

发布时间:2020-12-14 02:01:52 所属栏目:大数据 来源:网络整理
导读:用函数找大数 程序: ? #includestdio.h int max(int x,int y) { int z; z = x y ? x : y; return z; } int main() { int a,b,c; printf("please enter two integer numbers:"); scanf("%d,%d",a,b); c = max(a,b); printf("max is %dn",c); return 0; } 结

用函数找大数

程序:

?

#include<stdio.h>


int max(int x,int y)

{

int z;

z = x > y ? x : y;

return z;

}


int main()

{

int a,b,c;

printf("please enter two integer numbers:");

scanf("%d,%d",&a,&b);

c = max(a,b);

printf("max is %dn",c);

return 0;

}

结果:

lease?enter?two?integer?numbers:3,5

max?is?5

请按任意键继续.?.?.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读