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 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

  Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h &g...

Powered by Blogger.