fork(3) download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main(){
  4. int a,b,c,bedethailan=0;
  5. cin>>a>>b>>c;
  6. if(a>b) swap(a,b);
  7. if(a>c) swap(a,c);
  8. if(b>c) swap(b,c);
  9. if((a+b)%2!=0) bedethailan=bedethailan+2;
  10. cout<<(c-b)+(b-a)/2+bedethailan;
  11. }
Success #stdin #stdout 0s 4812KB
stdin
Standard input is empty
stdout
1057755146