Codeforces 1154 A. Restoring Three Numbers Solution

Solve in C++:
//AH Tonmoy
//Department of CSE ,Islamic University


#include<bits/stdc++.h>
using namespace  std;
int main()
{
int a[4],ar,b,c,i;
while(cin>>a[0]>>a[1]>>a[2]>>a[3])
{
   sort(a,a+4);
   ar=a[3]-a[0];
   b=a[3]-a[2];
   c=a[3]-a[1];
   cout<<ar<<" "<<b<<" "<<c<<endl;

}

}

No comments

Most View Post

Recent post

Codeforces Round 925 (Div. 3) 1931D. Divisible Pairs Solution

    Problem Link  :   https://codeforces.com/contest/1931/problem/D S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. ...

Powered by Blogger.