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 <stdio.h>
#include <math.h>

using namespace std;

double Max(double a,double b){
	if(a>=b){
		return a;
	}
	else{
		return b;
	}
}

double Min(double a,double b){
	if(a>=b){
		return b;
	}
	else{
		return a;
	}
}

int main(){

	double max=0,min=100000000;

	double tmp;

	while(cin>>tmp){
		if(tmp==0){
			break;
		}
		max = Max(max,tmp);
		min = Min(min,tmp);
	}

	cout<<(max-min)<<endl;
}

/*
Sample Input
3776.0
1819.0
645.2
2004.1
1208.6
Output for the Sample Input
3130.8
*/

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

using namespace std;

int main()
{
	double n;
	int cnt=0;
	double ans;
	vector<double> h;
	
	while(~scanf("%lf",&n)){
		h.push_back(n);
		cnt++;
	}
	sort(h.begin(),h.end());
	ans=(h[cnt-1]-h[0]);
	printf("%.1lf\n",ans);
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main() {

    float n;
    vector<float> m;

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

    sort(m.begin(), m.begin() + m.size(), greater<float>());

    printf("%.1f\n", m[0] - m[m.size() - 1]);

}

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

int main(){
    double d;
    vector<double> v;
    while(cin >> d) v.push_back(d);
    sort(v.begin(), v.end());
    printf("%.9f\n", v.back() - v.front());
}

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

int main(){
    double a,b,c;
    while(cin>>c){
        a=max(a,c);
        b=min(b,c);
    }
    cout<<a-b<<endl;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.diff", "r", stdin);
	string str = "";
	vector <double> high;

	while (getline (cin, str ) ){
		if (str.empty() ){
			break;
		} // end if
		stringstream ss(str);
		double h;
		ss >> h;
		high.push_back(h);
	} // end while
	
	sort (high.begin(), high.end() );

	double res = high[high.size() - 1] - high[0];

	cout << res << endl;	
		
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
    double x,high=0,low=1000000;
    while(cin>>x){
        if(x>high)high=x;
        if(x<low) low=x;
    }
    cout<<high-low<<endl;
}

C++: #include<iostream>

using namespace std;

int main(void) {
	double n=0,max=0,min=100;
	int i=5;
	while (i) {
		cin >> n;
		if (max == 0 && min == 100) {
			max = n;
			min = n;
		}
		else if (max < n) {
			max = n;
		}
		else if (min > n) {
			min = n;
		}
		i--;
	}
	cout << max - min << endl;
}

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

int main()
{
	double i, max = 0, min = 0;
	bool flag = true;

	while (cin >> i){
		if(flag){
			max = i;
			min = i;
			flag = false;
		}
		else{
			if (i < min)
				min = i;
			if (i > max)
				max = i;
		}
	}
	cout << max - min << endl;
	return 0;
}

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

int main()
{
	double n;
	double mi = 1e18, ma = 0.0;
	while (cin >> n)
	{
		ma = max(ma, n);
		mi = min(mi, n);
	}
	cout << (ma - mi) << endl;
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	double h, min = 0.0, max = 0.0;
	while(cin >> h){
		if( h > max ) max = h;
		else if( h < min ) min = h;
	}
	cout << fixed << setprecision(1) << max - min << endl;
}

C++: #include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
using namespace std;

int main(void)
{
   double yama;
   double ymax=0.0,ymin=1000005.0;
   double ans;
   while(scanf("%lf",&yama)!=EOF){
       ymax=max(ymax,yama);
       ymin=min(ymin,yama);
   }
   ans=ymax-ymin;
   printf("%.1f\n",ans);
   return 0;
}

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

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

C++: #include <stdio.h>

int main(){
	long double n;
	long double high,low;
	long double ans;
	scanf("%lf",&n);
	high = n;
	low = n;
	while(scanf("%lf",&n) != EOF){
		if(high < n){
			high = n;
		}
		if(low > n){
			low = n;
		}
	}
	ans = high - low;
	printf("%lf\n",ans);
	return 0;
}

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;
	double h1=10000.0;
	double h2=0.0;

	while(true){

	cin >> h;
	if(h==0.0) break;

	if(h<=h1) h1=h;
	if(h>=h2) h2=h;

	}

	cout << h2-h1 << endl;

	return 0;
}

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

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

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

using namespace std;



void Solution()
{
    int n = 0;
    double a[100];  // notice the definition.
    
    while (cin>>a[n])
    {
        n++;
    }
    
//    for (int i = 0; i < n - 1; i++)
//    {
//        for (int j = i + 1; j < n; j++)
//        {
//            if (a[i] < a[j])
//            {
//                double temp = a[i];          //swap
//                a[i] = a[j];
//                a[j] = temp;
//            }
//        }
//    }
    
    sort(a, a + n); //sorting as ascedning sequence
    
    //cout.setf(ios::fixed); //"setf" is used for “half-adjusting”
    //cout.precision(2);
    
//    cout<<a[0] - a[n - 1]<<endl;
    cout<<a[n - 1] - a[0]<<endl;
    
}

int main()
{
    Solution();
    return 0;
}

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

int main() {

  vector<double> yama;
  double input;

  while( cin >> input ) {

    yama.push_back(input);

  }

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

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

  return 0;

}