Accepted
Code
#include<bits/stdc++.h>
#define faster ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
void solution ()
{
vector<int> vec;
for(int i=0;i<4;i++)
{
int x; cin >> x;
vec.push_back(x);
}
int mx=vec[0],mn=vec[0];
for(int i=0;i<4;i++)
{
if(mx<vec[i]) mx=vec[i];
if(mn>vec[i]) mn=vec[i];
}
cout << mn << endl;
cout << mx << endl;
}
int main()
{
faster
int t=1 ;
//cin >> t ;
while(t--)
{
solution();
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1022 Minmax
- Contest
- Brain booster - 1
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2023-12-31 13:25:02
- Judged At
- 2024-11-11 03:46:43
- Judged By
- Score
- 100
- Total Time
- 1ms
- Peak Memory
- 560.0 KiB