Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	result := make([]int, 6)
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	for i := 0; i < n; i++ {
		scanner.Scan()
		h, _ := strconv.ParseFloat(scanner.Text(), 64)
		if h < 165.0 {
			result[0]++
		} else if 165.0 <= h && h < 170.0 {
			result[1]++
		} else if 170.0 <= h && h < 175.0 {
			result[2]++
		} else if 175.0 <= h && h < 180.0 {
			result[3]++
		} else if 180.0 <= h && h < 185.0 {
			result[4]++
		} else if 185.0 <= h {
			result[5]++
		}
	}
	for i := 0; i < 6; i++ {
		fmt.Printf("%d:", i+1)
		for j := 0; j < result[i]; j++ {
			fmt.Print("*")
		}
		fmt.Println()
	}
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

int f(double x) {
  return (x >= 165.0) + (x >= 170.0) + (x >= 175.0) +
         (x >= 180.0) + (x >= 185.0);
}

void solve() {
  int n;
  cin >> n;
  vi v(6);
  rep(i, n) {
    double h;
    cin >> h;
    v[f(h)]++;
  }
  rep(i, 6) cout << i + 1 << ':' << string(v[i], '*') << endl;
}

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

int main()
{
  int n;
  while (~scanf("%d", &n)) {
    vector<int> g(6, 0);
    for (int i = 0; i < n; ++i) {
      double h;
      scanf("%lf", &h);
      if (h < 165.0)
	++g[0];
      else if (h < 170.0)
	++g[1];
      else if (h < 175.0)
	++g[2];
      else if (h < 180.0)
	++g[3];
      else if (h < 185.0)
	++g[4];
      else
	++g[5];
    }

    for (int i = 0; i < 6; ++i) {
      printf("%d:", i+1);
      for (int j = 0; j < g[i]; ++j)
	printf("*");
      puts("");
    }
  }
  return 0;
}

C++: #include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; ++i)
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define P pair<int, int>

int main() {
  int n; cin >>n;
  vector<int> ans(6, 0);
  REP(i, n){
    double h; cin >>h;
    if(h < 165.0) ans[0] += 1;
    else if(h < 170.0) ans[1] += 1;
    else if(h < 175.0) ans[2] += 1;
    else if(h < 180.0) ans[3] += 1;
    else if(h < 185.0) ans[4] += 1;
    else ans[5] += 1;
  }
  REP(i, 6){
    cout <<i + 1 <<":";
    REP(j, ans[i]) cout <<"*";
    cout <<endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;main(){int r[6]={0},n,l,k;char c;for(cin>>n;n;n--){cin>>l>>c>>k;r[l>185?l=5:(l<165?l=0:l/5-32)]++;}for(k=0;k<6;k++){for(cout<<k+1<<":";r[k];r[k]--)cout<<"*";cout<<endl;}}

C++: #include <iostream>

using namespace std;

int main(){

	double ary[41];
	double n;
	int n1 = 0,n2 = 0,n3 = 0,n4 = 0,n5 = 0,n6 = 0;

	cin >> n;

	for(int i = 0; i < n; i ++){
		cin >> ary[i];

		if(ary[i] < 165){
			n1++;
		}else if(ary[i] >= 165 && ary[i] < 170){
			n2++;
		}else if(ary[i] >= 170 && ary[i] < 175){
			n3++;
		}else if(ary[i] >= 175 && ary[i] < 180){
			n4++;
		}else if(ary[i] >= 180 && ary[i] < 185){
			n5++;
		}else if(ary[i] >= 185){
			n6++;
		}
	}

	cout << "1:";
	for(int i = 1; i <= n1; i++){
		cout << "*" ;
	}
	cout << endl;

	cout << "2:";
	for(int i = 1; i <= n2; i++){
		cout << "*";
	}
	cout << endl;

	cout << "3:";
	for(int i = 1; i <= n3; i++){
		cout << "*";
	}
	cout << endl;

	cout << "4:";
	for(int i = 1; i <= n4; i++){
		cout << "*";
	}
	cout << endl;

	cout << "5:";
	for(int i = 1; i <= n5; i++){
		cout <<"*";
	}
	cout << endl;

	cout << "6:";
	for(int i = 1; i <= n6; i++){
		cout << "*";
	}
	cout << endl;

	return 0;
}

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

int main(){

  double x;
  int n,a[10] = {0};
  cin >> n;

  for(int i=0;i<n;i++){
    cin >> x;

    if(185 <= x) a[6]++;
    else if(180 <= x) a[5]++;
    else if(175 <= x) a[4]++;
    else if(170 <= x) a[3]++;
    else if(165 <= x) a[2]++;
    else a[1]++;

  }

  for(int i=1;i<=6;i++){
    n = a[i];
    cout << i << ":";
    for(int j=0;j<n;j++) cout << "*";
    cout << endl;
  }
}

C++: #include<iostream>
#include<cstring>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
#include<cstdio>
#include<cmath>
#define pb push_back
#define mp make_pair
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) loop(i,0,b)
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
using namespace std;
int main(){
	double h[6]={165.0,170.0,175.0,180.0,185.0,9999};
	int co[6]={0};
	int n;
	cin>>n;
	rep(i,n){
		double in;
		cin>>in;
		rep(j,6)if(in<h[j]){co[j]++;break;}
	}
	rep(i,6){
		cout<<i+1<<":";
		rep(j,co[i])cout<<"*";
		cout<<endl;
	}
}

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

int checkHeight(double h);

int main()
{
    int n;
    int count[6] = {};
    cin >> n;

    for(int i = 0; i < n; i++)
    {
        double height;
        cin >> height;
        count[checkHeight(height)]++;
    }
    for(int i = 0; i < 6; i++)
    {
        cout << i + 1 << ":";
        for(int j = 0; j < count[i]; j++)
        {
            cout << "*";
        }
        cout << endl;
    }
    return 0;
}

int checkHeight(double h)
{
    int ret_value = 0;
    if(isless(h, 165.0))
    {
        ret_value = 0;
    }
    else if(isless(h, 170.0))
    {
        ret_value = 1;
    }
    else if(isless(h, 175.0))
    {
        ret_value = 2;
    }
    else if(isless(h, 180.0))
    {
        ret_value = 3;
    }
    else if(isless(h, 185.0))
    {
        ret_value = 4;
    }
    else
    {
        ret_value = 5;
    }
    return ret_value;
}

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


using namespace std;

int main(void)
{
	int num;
	cin >> num;

	int p1 = 0, p2 = 0, p3 = 0, p4 = 0, p5 = 0, p6 = 0;
	float tmp;

	for (int i = 0; i < num; i++)
	{
		cin >> tmp;

		if (tmp < 165.0)
			p1++;
		else if (165.0 <= tmp < 170.0)
			p2++;
		else if (170.0 <= tmp < 175.0)
			p3++;
		else if (175.0 <= tmp < 180.0)
			p4++;
		else if (180.0 <= tmp < 185.0)
			p5++;
		else
			p6++;

	}

	cout << "1:";
	for (int i = 0; i < p1; i++)
		cout << "*";
	cout << endl;

	cout << "2:";
	for (int i = 0; i < p2; i++)
		cout << "*";
	cout << endl;

	cout << "3:";
	for (int i = 0; i < p3; i++)
		cout << "*";
	cout << endl;

	cout << "4:";
	for (int i = 0; i < p4; i++)
		cout << "*";
	cout << endl;

	cout << "5:";
	for (int i = 0; i < p5; i++)
		cout << "*";
	cout << endl;

	cout << "6:";
	for (int i = 0; i < p6; i++)
		cout << "*";
	cout << endl;


}