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

RESTful APIs with CRUD Operations in Laravel 12| (2025)

  RESTful APIs serve as the foundation of modern web development. They follow a set of rules called Representational State Transfer (REST) t...

Powered by Blogger.