首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
首页
>
试题广场
>
小乐乐计算函数
[编程题]小乐乐计算函数
热度指数:27318
时间限制:C/C++ 1秒,其他语言2秒
空间限制:C/C++ 256M,其他语言512M
算法知识视频讲解
小乐乐学会了自定义函数,BoBo老师给他出了个问题,根据以下公式计算m的值。
其中 max3函数为计算三个数的最大值,如: max3(1, 2, 3) 返回结果为3。
输入描述:
一行,输入三个整数,用空格隔开,分别表示a, b, c。
输出描述:
一行,一个浮点数,小数点保留2位,为计算后m的值。
示例1
输入
1 2 3
输出
0.30
马上挑战
算法知识视频讲解
提交运行
算法知识视频讲解
添加笔记
求解答(3)
邀请回答
收藏(68)
分享
提交结果有问题?
86个回答
83篇题解
开通博客
viod
发表于 2021-06-07 11:31:03
先定义一个max3()函数返回3个数的最大,然后主函数调用max3()计算: #include<stdio.h> int max3(int a,int b,int c){ if(a>b) b=a; return b>c?b:c; } int main(){
展开全文
Zerone·
发表于 2022-05-27 18:30:06
">int max3(float a, float b, float c) { if (a >= b && a >= c) return a; else if (b >= a && b >= c) return b; e
展开全文
叶花永不相见
发表于 2022-03-05 20:20:36
#include<stdio.h> int max3(int a, int b, int c) { int max = a; if(max < b) max = b; if(max < c) max = c; r
展开全文
牛客575029355号
发表于 2022-05-18 20:59:05
#include<stdio.h> int max3(int a,int b,int c) { return a>b? a>c?a:c : b>
展开全文
canwen
发表于 2022-06-14 10:28:14
#2022/6/14 10:27 a,b,c=map(int,input().split()) max1=max(a+b,b,c) max2=max(a,b+c,c) max3=max(a,b,b+c) m=max1/(max2+max3) print("{:.2f}".format(m))
melon.
发表于 2022-12-24 15:13:16
def f(a,b,c): if a > b: max = a else: max = b if max < c: max = c return max nums = input() lst
展开全文
克里里克kliric
发表于 2024-11-23 23:16:43
#include <stdio.h> int max(int x, int y, int z)//最大函数 { int arr[3] = {0}; arr[0] = x; arr[1] = y; arr[2] = z; int i; in
展开全文
new_jytx
发表于 2024-01-02 15:54:41
#include<stdio.h> int max3(a, b, c) { if (a > b && a > c) return a; else if (b > a && b > c)
展开全文
刘肯搏
发表于 2024-10-21 16:47:16
#include <stdio.h> int main() { int max(int a,int b,int c); int a,b,c; scanf("%d %d %d",&a,&b,&c); int x,y
展开全文
宿傩大爷
发表于 2023-11-19 21:19:20
#include <stdio.h> int max3(int a,int b,int c) { int max=a>(b>c?b:c)?a:(b>c?b:c); return max; } int main() { int a,b,c;
展开全文
问题信息
上传者:
牛客309119号
难度:
86条回答
68收藏
3634浏览
热门推荐
通过挑战的用户
查看代码
许骏雄
2024-02-24 15:39:18
刘俊霖
2023-05-13 21:00:57
你丫三条
2023-03-07 18:18:03
lyn__
2023-01-19 11:36:23
小牛刀lyy
2022-09-18 12:45:16
相关试题
执行以下程序,理论上输出的结果应最...
360集团
Python
算法工程师
2019
评论
(1)
来自
360公司-2019校招...
以下描述正确的是
Java
评论
(1)
以下对于随机森林算法描述错误的是:
机器学习
评论
(1)
生成数据集的随机子集
机器学习
评论
(1)
k近邻算法
机器学习
评论
(1)
小乐乐计算函数
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题
1 2 3
0.30