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 <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
using namespace std;

int main(){
	int i;
	double h,max=0,min;
	while(scanf("%lf",&h)!=EOF){
		//if(h==0) break;
		i++;
		if(i==1) min=h;
		if(min>h) min=h;
		if(max<h) max=h;
	}
	//cout<<max<<endl;
	//cout<<min<<endl;
	cout<<max-min<<endl;
}

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

int main(){
	float max = 0, min = 1000000, in;
	while (true)
	{
		cin >> in;
		if (cin.eof()) { break; }
		if(max<in){
			max = in;
		}
		else if (min > in){
			min = in;
		}
		cout << max - min << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main() {
    vector<double> a;
    double x;
    while (~scanf("%f", &x)){
        a.push_back(x);
    }
    double mi = 1e9; ma = 0;
    REP(i,a.size()){
        mi = fmin(mi, a[i]);
        ma = fmax(ma, a[i]);
    }
    cout << ma - mi << endl;

    return 0;
}

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

using namespace std;

int main(){
	int i;
	float ansmax, ansmin = 100000;
	float mou[101];

	for(i = 0; i < 50; i++){

		cin >> mou[i];

		if(mou[i] == 0) break;

		ansmax = max(ansmax,mou[i]);
		ansmin = min(ansmin,mou[i]);

	}

	cout << ansmax - ansmin << endl;

	return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
#include<cmath>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)


int main(){
	
	vector<double> a;
	double b;
	while(cin>>b){
		a.push_back(b);
	}
	
	sort(a.begin(),a.end());
	
	printf("%lf\n",a[a.size()-1]-a[0]);
}

C++: /*
 * src.cpp
 *
 *  Created on: 2016/07/26
 *      Author: joi
 */

#include <bits/stdc++.h>

using namespace std;

double a[50];

int main(){
	int i=0;
	while (scanf("%lf",&a[i])!=EOF){
		i++;
	}
	sort(a,a+i);
	cout<<a[i-1]-a[0]<<endl;
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

int main(){
	double h;
	vector<double>vh;
	vector<double>::iterator pvh=vh.begin();
	while(cin>>h){
		vh.push_back(h);		
		}
		sort(vh.begin(),vh.end());
		double a=*pvh;
		pvh=vh.end();
		double b=*pvh;
		double c=b-a;
		cout<<c<<endl;
		
		return 0;
	}

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

int main(){
  double x;
  double max_h = 0, min_h = 999999999;

  while(cin >> x){
    max_h = max(max_h, x);
    min_h = min(min_h, x);
  }

  cout << max_h - min_h << endl;
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<algorithm>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    double m[1000];
    double high, low;
    int i = 0;

    while(cin >> m[i++]){
        ;
    }
    sort(m, m+i-1);
    high = m[i-2];
    low = m[0];
    cout << high - low << endl;
}

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

#define HIGH 1000000;

int main(void) {
	double h;
	double max = 0;
	double min = HIGH;
	
	while(cin >> h) {
		if(h > max) {
			max = h;
		}
		if(h < min) {
			min = h;
		}
	}
	
	printf("%.1lf\n", max - min);
	
	return 0;
}

C++: #include<iostream>
#include<iomanip>

using namespace std;

template<typename T>
bool chmax(T& a, T b){
    if(a < b){
        a = b;
        return true;
    }
    return false;
}

template<typename T>
bool chmin(T& a, T b){
    if(b < a){
        a = b;
        return true;
    }
    return false;
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    double h;
    double ma = -1;
    double mi = 101010101;
    while(cin >> h){
        chmax(ma, h);
        chmin(mi, h);
    }

    cout << fixed << setprecision(3) << ma - mi << endl;

    return 0;
}

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

int main()
{
    multiset<double> h;
    double height;
    while(cin >> height)
    {
        h.insert(height);
        cout << height << endl;
    }
    double best = *(--h.end());
    double worst = *(h.begin());

    cout << best - worst << endl;
    return 0;
}

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

C++: #include<iostream>

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

	bool flg=1;

	while(std::cin >> height)
	{
		if(flg)
		{
			max=height;

			min=height;

			flg=0;
		}

		if(height>max)
		{
			max = height;
		}

		if(height<min)
		{
			min = height;
		}
	}

	std::cout << max-min << '\n';
}

C++: #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;

int main()
{
    double n;
    double minv = INT_MAX, maxv = 0;
    while (cin >> n)
    {
        if (maxv < n)
            maxv = n;
        if (minv > n)
            minv = n;
    }

    printf("%.3f", maxv - minv);
    return 0;
}

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

using namespace std;

int main(){
	double n,a,b;
	vector<double> v;

	while(cin>>n){
		v.push_back(n);
	}

	a=v[0];
	b=v[0];

	for(int i=0;i<n;i++){
		a=max(a,v[i]);
		b=min(b,v[i]);
	}

	double ans=a-b;
	
	cout<<ans<<endl;

}

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

using namespace std;

vector<double> mt;

int main() {
	
	double a;
	mt.clear();
	
	int b = 0;
	
	while( cin >> a)
	{
		mt.push_back(a);	
		b++;		
	}
	sort(mt.begin(), mt.end());
	cout << fixed << setprecision(6) << mt[b] - mt[0] << "\n";
	
	
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main() {
	double d;
	cin >> d;
	double minn = d, maxx = 0;
	while (cin >> d) {
		minn = min(d, minn);
		maxx = max(d, maxx);
	}
	cout << maxx - minn << endl;
	char c;
	cin >> c;
}

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 (vector<float>::iterator 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>

using namespace std;

int main() {
	double a,m=0,s=1000000;
    while(cin>>a){
        m=max(m,a);
        s=min(s,a);
    }
    cout<<m-s<<endl;
	return 0;
}