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>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

int main()
{
//	cut here before submit 
//	freopen ("testcase.Differential", "r", stdin );
	double h;
	double minh = 1e100;
	double maxh = 0.0;
	while (~scanf ("%lf", &h ) ){
//		cerr << "h: " << h << endl;
		minh = min (minh, h );
		maxh = max (maxh, h );
	} // end loop
	printf ("%.5f\n", maxh-minh );
		
	return 0;
}

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

int main(){
        vector<double> num;
        double h;
        while(cin >> h){
                num.push_back(h);
        }
        sort(num.begin(), num.end());
        cout << num.end() - num.begin() << endl;
        return 0;
}

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

int main(){
    double mi, ma, h;
    mi = 1e100;
    ma = -1;
    while(cin >> h){
        mi = min(h,mi);
        ma = max(h,ma);
    }
    cout << ma-mi << endl;
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    double hMin = INT_MAX;
    double hMax = INT_MIN;

    for(;;){
        double n;
        if(!(cin >> n))
            break;

        hMin = min(hMin, n);
        hMax = max(hMax, n);
    }

    printf("%.10f\n", hMax - hMin);
    return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;


int main(){
	double maxp=numeric_limits<double>::min();
	double minp=numeric_limits<double>::max();

	double peak;
	while(~scanf("%lf",&peak)){
		maxp = max(peak,maxp);
		minp = min(peak,minp);
	}

	printf("%lf\n",maxp-minp);
}

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

int main(){
    double n;
    vector<double>v;
    while(cin>>n){
        v.push_back(n);
    }   
    double a=v[0];
    double b=v[0];
    for(int i=0; i<v.size();i++){
        a=max(a,v[i]);
        b=min(b,v[i]);
    }   
    cout<<(a-b)<<endl;
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
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);
		
	}
	printf("%.1f\n", ans);
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <map>
 
using namespace std;
 
const double eps=1e-10;

int main()
{

	double _min,_max;
	cin>>_min;
	_max=_min;

	double t;
	while(cin>>t){
		_min=min(_min,t);
		_max=max(_max,t);
	}

	cout<<_max-_min<<endl;

	return 0;
}

C++: #include <stdio.h>
int main(){
double top,bot,temp;
scanf("%lf",&top);
bot=top;
while(scanf("%lf",&temp)!=EOF){
if(temp>top)top=temp;
if(temp<bot)bot=temp;
}
printf("%lf\n",top-bot);
}

C++: #include<iostream>

using namespace std;

int main(){
	double ma=-1,mi=-1;
	double x;
	while(cin>>x){
		if(ma==-1 || ma<x)ma=x;
		if(mi==-1 || mi>x)mi=x;
	}
	
	cout<<ma-mi<<endl;
}

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


int main()
{
    double minv = 1000001, maxv = 0, t;
    while (scanf("%lf", &t) != EOF) {
        minv = min(minv, t);
        maxv = max(maxv, t);
    }
    printf("%.3lf\n", maxv-minv);
    return 0;
}

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

int main(){
	const string tmp(1048575, '0');

	istream_iterator<double> first(cin), last;
	vector<double> v(first, last);
	printf("%f", *max_element(v.begin(), v.end()) - *min_element(v.begin(), v.end()));
	
	for(int i = 0; i < 10; ++i){
		fputs(tmp.c_str(), stdout);
		fflush(stdout);
	}
	
	puts("");
}

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

int main()
{
	double mountain;
	cin >> mountain;
	double high=mountain,low=mountain;
	while(cin >> mountain){
		high = max(high,mountain);
		low = min(low,mountain);
	}
	cout << high - low << endl;
	return 0;
}

C++: #include<iostream>
 using namespace std;int main(){double a,tans,hans;cin >> a;tans = a; hans = a;while(cin>>a) if(tans>a) tans = a; if(hans<a) hans = a;cout << hans - tans << endl;}

C++: #include<string>
#include<vector>
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<functional>
#include<algorithm>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<utility>
#include<cmath>
#include<ctime>
#include<complex>

using namespace std;

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)

int main(){

	double h;
	vector<double>v;

	while(cin >> h){

    v.push_back(h);

	}

	sort(v.begin(),v.end());

	cout << v[v.size()-1]-v[0] << endl;

	return 0;
}

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

int main(){
  double mountain[1111],ans;
  int i=0;
  while(cin >> mountain[i]){
    i++;
  }
  sort(mountain,mountain+i);
  ans = mountain[i-1] - mountain[0];
  cout << ans << endl;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
using namespace std;
int main(){
double x;
vector<double> v;
while(cin>>x){
v.push_back(x);
}
sort(v.begin(),v.end());
printf("%.5f\n",v[v.size()-1]-v[0]);
return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
int main() {
	double n,max=0,min=1000000;
	while (cin >> n) {
		if (n > max)max = n;
		if (n <min)min = n;
	}
	cout << max - min << endl;
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  double haight[5],dammy,sa;
  for(int i=0;i<5;i++){
    cin >> haight[i];
  }
  while(1){
    if(haight[0]<haight[1]&& haight[1]<haight[2] && haight[2]<haight[3])break;
   for(int i=1;i<5;i++){
     if(haight[i-1]>haight[i]){
       dammy =haight[i-1];
       haight[i-1]=haight[i];
       haight[i]=dammy;
     }
   }
        
   }    
  sa= haight[4]-haight[0];
  cout << sa << endl;






  return 0;
}

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

using namespace std;

int main()
{
  double n, h = 0.0, l = 999999.0;

  while (scanf("%lf", &n)){
    h = max(h, n);
    l = min(l, n);
  }

  printf("%.1lf\n", h - l);
}