Răspuns:
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int a,b,c,min1,max1;
cin>>a>>b>>c;
if(a>b && a>c)
max1=a;
if(b>a && b>c)
max1=b;
if(c>b && c>a)
max1=c;
if(a<b && a<c)
min1=a;
if(b<a && b<c)
min1=b;
if(c<b && c<a)
min1=a;
cout<<max1-min1;
return 0;
}
Explicație: