723A. The New Year: Meeting Friends Solution

  1. #include<iostream>
  2. #include<algorithm>
  3. using namespace std;
  4. int main()
  5. {
  6. int arr[3];
  7. cin>>arr[0]>>arr[1]>>arr[2];
  8. sort(arr,arr+3);
  9. cout<<arr[1]-arr[0]+abs(arr[1]-arr[2]);
  10. }

Comments

Popular posts from this blog

Codeforce Problem 1703A. YES or YES?

1535A. Fair Playoff

Aptitude test assistant programmer 2018