当前位置:网站首页>[CCF CSP] 201903-1 small, medium and large
[CCF CSP] 201903-1 small, medium and large
2022-07-22 04:01:00 【Jenny, Jenny】
Problem description
Question number : | 201903-1 |
The title of the test question : | Small, medium and large |
The time limit : | 1.0s |
Memory limit : | 512.0MB |
Problem description : |
|
#include<bits/stdc++.h>
using namespace std;
int main() {
int n, a1, a2, m;
double mid;
cin >> n >> a1;
if (n == 1) {
cout << a1 << ' ' << a1 << ' ' << a1;
return 0;
}
else if (n == 2) {
cin >> a2;
cout << max(a1,a2) << ' ' << (a1 + a2) / 2.0 << ' ' << min(a1,a2);
}
m = (n-1) / 2;
while (m--)
{
cin >> mid;
}
if (!(n % 2)) {
cin >> a2;
mid = (mid + a2) / 2.0;
}
m = (n - 1) / 2;
while (m--)
{
cin >> a2;
}
cout << max(a1, a2) << ' ' << mid<< ' ' << min(a1, a2);
return 0;
}
边栏推荐
- Scala函数的柯里化
- MONAI Label 安装流程及使用攻略
- 10 papers of ant security laboratory were included by ccf-a top meeting to explore the realization of AI credibility from the perspective of algorithm
- JS advanced Es5 implementation inheritance
- Converter
- 【CCF CSP】201803-1跳一跳
- 第三章课后习题15-23
- 3.3栈和队列的应用
- H3C build small and medium-sized enterprise network (NE)
- Hutool工具类和工具方法
猜你喜欢
随机推荐
5.1 identity authentication
When servlet writes webapp, filter interception is used to realize login verification
一款免费听音乐和下载的播放器
Object类的equals()方法
mysql新增用户无法授权的解决方案
Application of SCA on devsecops platform
About thread Sleep() method
When idea creates a folder, the empty folder of the folder expands and overlaps
MysqlWorkBench性能分析工具--性能仪表盘
Flink使用api执行sql的时候报错
【CCF CSP】201712-1最小差值
Convolutional Neural Networks in TensorFlow quizs on Coursera
50个名额限量开放|带着OceanBase年度发布会的消息走来了!
Integer
栈的应用
获取模块句柄/基址
读《读大学,究竟读什么》读后感
Athlete and coach case code
【CCF CSP】201803-1跳一跳
从浏览器上传、下载Excel文件到数据库