HBU OJ003
2020-02-03 04:24
141 查看
HBU OJ003
#编写一个函数,返回三个数的中间值,并在主函数中调用这个函数,实现其功能。
//我不会,呜呜呜呜呜,贴上搜的答案,搜的答案系统没给我过【我看他就是故意刁难我】 //#include "stdafx.h"//If the vc++6.0, with this line. #include <stdio.h> int midnum(int a,int b,int c){ if(a>=b && b>=c || c>=b && a<=b) return b; else if(a>=c && c>=b || b>=c && a<=c) return c; else return a; } int main(void){//测试一下正确性…… int a=9,b=0,c=7; printf("The MID is %d\n",midnum(a,b,c)); return 0; }
##啊啊啊啊啊啊啊啊啊,快去学习
- 点赞
- 收藏
- 分享
- 文章举报