Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func read() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanLines)
	max := 0.0
	min := 1000000.0
	for sc.Scan() {
		n, _ := strconv.ParseFloat(sc.Text(), 64)
		if max < n {
			max = n
		}
		if min > n {
			min = n
		}
	}
	fmt.Println(max - min)
}

C++: #include <iostream>
#include <vector>
using namespace std;

int main() {
	vector<float> h;
	float tmp,max,min;

	while (cin >> tmp) h.push_back(tmp);

	max = min = h[0];
	for (auto it = h.begin() + 1; it != h.end(); ++it) {
		if (*it > max) max = *it;
		if (*it < min) min = *it;
	}

	cout << max - min << endl;
	
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main(){
	vector<float> v;
	float input;
	while(cin >> input){
		v.push_back(input);
		sort(v.begin(), v.end());
		float ans;
		vector<float>::iterator ite;
		ite = v.end();
		ans = *(ite-1) - v.at(0);
		cout << ans << endl;
	}

	return 0;
}

C++: #include<stdio.h>

int main(){
	double a;
	double max=0,min=999999999;
	while(~scanf("%lf",&a)){
		if(max<a)max=a;
		if(min>a)min=a;
	}
	printf("%lf\n",max-min);
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;

int main(){
	int i=0;
	double m[10000];
	
	while( scanf(" %lf", &m[i]) != EOF ) ++i;
	
	sort(m, m+i);
	printf("%lf\n", m[i-1]-m[0]);

	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <climits>
#include <cfloat>
#include <string>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define INF INT_MAX
#define BINF DBL_MAX

int main(){
	double mx = 0;
	double mn = BINF;
	double h;
	while (cin >> h){
		if (h<mn) mn = h;
		if (h > mx) mx = h;
	}
	cout << mx - mn << endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <string>
#include <math.h>
#include <cmath>
#include <cstring>
#include <sstream>
#include <stdlib.h>
#include <iomanip>
//#include <vector>

using namespace std;

int main (void)
{
	long double a = 0.0,b = 1000000.0,p;
	int co = 0;
	while (cin >> p)
	{
		if (a < p)
		{
			a = 0.0;
			a = p;
		}
		if (b > p)
		{
			b = 0.0;
			b = p;
		}
		p = 0;
	}

	cout << a - b << endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;

#define N 5
int main(){
	double height[N];
	
	for(int i=0;i<N;i++){
		cin >> height[i];
	}
	
	sort(height,height+N);
	
	double heightd = height[N-1] - height[0];
	cout << heightd << endl;
	
	return 0;
}

C++: #include<iostream>
using namespace std;

int main(){
	double max=0,min=100000;
	double h;

	while(cin >> h){
		if(h > max)max = h;
		if(h < min)min = h;
	}
	cout << max - min << endl;

}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <string>
#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(int x=from;x<to;x++)

using namespace std;




int main(void){
 
double hi,hmx=-999,hmn=99999999;
	while(cin >> hi){
		hmx = max(hmx, hi);
		hmn = min(hmn, hi);
	}

	printf("%.1lf\n",hmx-hmn);
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main() {
	double a;
	cin >> a;
	double minn, maxx;
	minn = a;
	maxx = 0;
	while (cin >> a){
		maxx = max(a, maxx);
		minn = min(a, minn);
	}
	printf("%6f", maxx - minn);
	cout << endl;
	char c;
	cin >> c;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;

int main()
{
	double height;
	double Min=100000000, Max=0;
	while(cin>>height){
		Min = min( Min, height );
		Max = max( Max, height);
	}
	
	double difference = Max - Min;
	cout<<difference<<endl;
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <ctime>
using namespace std;

#define rep(i,a,n) for(int i=a; i<n; i++)
#define repr(i,a,n) for(int i=a; i>=n; i--)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 999999999

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))

typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long int ll;

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int const MOD = 1000000007;

namespace std {
    bool operator<(const P a, const P b) {
        return a.X != b.X ? a.X < b.X : a.Y < b.Y;
    }
}

int main() {
    double n;
    double max_n = 0, min_n = INF;
    while(cin >> n) {
        max_n = max(max_n, n);
        min_n = min(min_n, n);
    }
    cout << max_n - min_n << endl;
    return 0;
}

C++: #include<iostream>
#include<vector>
int main(){
	float n,max=0,mini=10000000;
	std::vector<int> high;
	while(1){
		std::cin>>n;
		high.push_back(n);
		if(std::cin.eof())break;
		//if(n==1000)break;
		if(n>max)max=n;
		if(n<mini)mini=n;
	}
	std::cout<<max-mini<<std::endl;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
int main()
{
	double 			input;
	std::vector<double> 	height;
	while (std::cin >> input) {
		height.push_back(input);
	}
	sort(height.begin(), height.end());
	std::cout << *(height.end()-1) - *(height.begin()) << std::endl;
}

C++: #include <iostream>
#include <cstdio>
using namespace std;

int main(void){
  double highest = 0.0, lowest = 1.797693e+308, now;
  while(cin >> now){
    if(now > highest) highest = now;
    else if(now < lowest) lowest = now;
  }
  printf("%.1f\n", highest - lowest);
  return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>

using namespace std;
typedef long long ll;

#define PI 3.141592653

int main(){
    double h[100000]={0};
    int n;
    
    for(int i=0;EOF!=scanf("%lf",&h[i]);i++) n++;
    
    sort(h,h+n);
    
    printf("%lf\n",h[n-1]-h[0]);
    
    return 0;
}

C++: #include<stdio.h>

int main()
{
	double a[1000]={0},dumy;
	int x=0;
	while(scanf("%lf",&a[x])!=EOF)
	{
		x++;
	}

	for(int i=0;i<x;i++)
	{
		for(int j=0;j<x;j++)
		{
			if(a[i]>a[j])
			{
				dumy=a[i];
				a[i]=a[j];
				a[j]=dumy;
			}
		}
	}

	printf("%.1f",a[0]-a[x-1]);
}

C++: #define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <utility>
#include <numeric>

using namespace std;
typedef long long llong;
typedef unsigned long long ullong;

const ullong MOD = 1000000000 + 7;

int main()
{
	double maxh = 0, minh = 1000000;

	double h;
	for (; cin >> h;)
	{
		maxh = max(maxh, h);
		minh = min(minh, h);
	}

	cout << maxh - minh << endl;
}

C++: #include<iostream>
using namespace std;

int main() {
	float max,min;
	float input;
	
	cin >> input;
	max = input;
	min = input;
	while ( cin >> input ) {
		if ( input < min )
			min = input;
		else if ( input > max )
			max = input;
	}
	cout << max - min << endl;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main(){
  vector<double> heightarray;
  double height;
  while(cin>>height){
    heightarray.push_back(height);
  }
  sort(heightarray.begin(),heightarray.end());
  cout<<-heightarray[0]+heightarray[heightarray.size()-1]<<endl;
}