Codeforces Round #835 (Div. 4) A. Medium Number
admin
2024-02-10 14:43:14

Codeforces Round #835 (Div. 4) A. Medium Number

Here are two ways to implement what’s given in the problem:

  1. Take input as an array [a1,a2,a3][a_1,a_2,a_3][a1​,a2​,a3​], and sort it. Output the middle element.
  2. Write two if-statements. The first: if (a>b(a>b(a>b andandand ac)a>c)a>c), output aaa. Else, if (b>a(b>a(b>a andandand bc)b>c)b>c), output bbb. Else, output ccc.
#include
using namespace std;int main()
{int T=1;cin>>T;while(T--){int a[3];cin>>a[0]>>a[1]>>a[2];sort(a,a+3);cout<

相关内容

热门资讯

最新最新或2023(历届)歇后...  1、开水锅里洗澡——熟人。   2、看见岳父不搭腔——有眼不识泰山。  3、吃菠萝问酸甜——明知故...
最新或2023(历届)英语圣诞...  圣诞节的英语简介   The word Christmas comes from the word...