fork(2) download
  1. #include<iostream>
  2. #include<bits/stdc++.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int a,b,c;
  9. cin>>a>>b>>c;
  10.  
  11. if((a>b)&&(b>c))
  12. cout<<a-c<<endl;
  13. if((a>c)&&(c>b))
  14. cout<<a-b<<endl;
  15. if((b>a)&&(a>c))
  16. cout<<b-c<<endl;
  17. if((b>c)&&(c>a))
  18. cout<<b-a<<endl;
  19. if((c>b)&&(b>a))
  20. cout<<c-a<<endl;
  21. if((c>a)&&(a>b))
  22. cout<<c-b<<endl;
  23.  
  24. if((a==0)&&(b==0)&&(c==0))
  25. cout<<0<<endl;
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Standard output is empty