Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	table := [10]string{
		"* = ****",
		"* =* ***",
		"* =** **",
		"* =*** *",
		"* =**** ",
		" *= ****",
		" *=* ***",
		" *=** **",
		" *=*** *",
		" *=**** ",
	}
	for scanner.Scan() {
		tmp := strings.Split(fmt.Sprintf("%05s", scanner.Text()), "")
		ans := make([]string, 0)
		for _, v := range tmp {
			iv, _ := strconv.Atoi(v)
			ans = append(ans, table[iv])
		}
		for i := 0; i < 8; i++ {
			for j := 0; j < 5; j++ {
				fmt.Print(string(ans[j][i]))
			}
			fmt.Println()
		}
		fmt.Println()
	}
}

C++: #include <iostream>
using namespace std;
int main(){
	char ball[10][8] = {{'*',' ','=',' ','*','*','*','*'},
											{'*',' ','=','*',' ','*','*','*'},
											{'*',' ','=','*','*',' ','*','*'},
											{'*',' ','=','*','*','*',' ','*'},
											{'*',' ','=','*','*','*','*',' '},
											{' ','*','=',' ','*','*','*','*'},
											{' ','*','=','*',' ','*','*','*'},
											{' ','*','=','*','*',' ','*','*'},
											{' ','*','=','*','*','*',' ','*'},
											{' ','*','=','*','*','*','*',' '}};
	string i;
	int b = 0;
	while(cin >> i,!cin.eof()){
		if(b)cout<<endl;
		else{b=1;}
		while(i.size() < 5)i = '0' + i;
		for(int k=0;k<8;k++){
			for(int l=0;l<5;l++){
				cout << ball[i[l]-'0'][k];
			}
			cout << endl;
		}
	}
}

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

char n[10][12]={
	"* = ****","* =* ***","* =** **","* =*** *","* =**** ",
	" *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "
};

int main(void){
	int i,j,set,x;
	char s[8];

	for(set=0;cin>>x;set++){
		if(set) cout<<endl;
		sprintf(s,"%05d",x);

		for(i=0;i<8;i++){
			for(j=0;j<5;j++){
				cout<<n[s[j]-'0'][i];
			}
			cout<<endl;
		}
	}

	return 0;
}

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

int main()
{	
	int n;
	bool f = 0;

	while (cin >> n) {
		int a[5];
		string s[8];

		if (!f)
			f = 1;
		else
			cout << endl;

		for (int i = 0; i < 5; i++) {
			a[4 - i] = n % 10;
			n /= 10;
		}

		for (int i = 0; i < 5; i++) {
			if (a[i] > 4) {
				s[0] += " ";
				s[1] += "*";
			}
			else {
				s[0] += "*";
				s[1] += " ";
			}
				
			s[2] += "=";

			if (a[i] % 5 == 0)
				s[3] += " ";
			else
				s[3] += "*";

			if (a[i] % 5 == 1)
				s[4] += " ";
			else
				s[4] += "*";

			if (a[i] % 5 == 2)
				s[5] += " ";
			else
				s[5] += "*";

			if (a[i] % 5 == 3)
				s[6] += " ";
			else
				s[6] += "*";

			if (a[i] % 5 == 4)
				s[7] += " ";
			else
				s[7] += "*";
		}
		
		for (int i = 0; i < 8; i++)
			cout << s[i] << endl;
	}

	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n,i,x=0;
	char a[8][6];
	for(i=0;i<8;++i)
		a[i][5]='\0';
	char t[] = "* ";
	while(scanf("%d",&n)>0)
	{
		for(i=4;i>=0;--i)
		{
			a[0][i] = t[n%10>=5];
			a[1][i] = t[a[0][i]=='*'];
			a[2][i] = '=';
			a[3][i] = t[n%5==0];
			a[4][i] = t[n%5==1];
			a[5][i] = t[n%5==2];
			a[6][i] = t[n%5==3];
			a[7][i] = t[n%5==4];
			n /= 10;
		}
		printf("%s",(x++?"\n":""));
		for(i=0;i<8;++i)
			printf("%s\n",a[i]);
	}
	return 0;
}

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

int main(){
	int n,i,j;
	int a[5];
	char a0[11][10]={"* = ****","* =* ***","* =** **","* =*** *","* =**** "," *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "};
	cin>>n;
	a[0]=n/10000;
	a[1]=(n-a[0]*10000)/1000;
	a[2]=(n-a[0]*10000-a[1]*1000)/100;
	a[3]=(n-a[0]*10000-a[1]*1000-a[2]*100)/10;
	a[4]=(n-a[0]*10000-a[1]*1000-a[2]*100-a[3]*10);
	//cout<<a[0]<<a[1]<<a[2]<<a[3]<<a[4];
	for(i=0;i<8;i++){
		for(j=0;j<5;j++){
			cout<<a0[a[j]][i];
		}
		cout<<endl;
		
	}
	//cin>>i>>j;
	//cout<<a0[i][j];
	return 0;
}

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

int main(){
  int i,j,a,b,c;
  while(cin >> a){
    for(j=0;j<=5;j+=5){
      b = a;
      for(i=10000;i>=1;i/=10){
	if(b/i == j || b/i == j+1 || b/i == j+2 || b/i == j+3 || b/i == j+4) cout << "*";
	else cout << " ";

        c = b / i;
	b = b - c * i;

      }
      cout << endl;
    }
    
    cout << "=====" << endl;
    
    for(j=0;j<5;j++){
      b = a;
      for(i=10000;i>=1;i/=10){
	if(b/i == j || b/i == j+5) cout << " ";
	else cout << "*";

	c = b / i;
	b = b - c * i;

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

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed 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

template<typename V>
constexpr string join(const V &v, const string &sep) {
  stringstream ss;
  if (v.size()) ss << v[0];
  loop(i, 1, v.size()) ss << sep << v[i];
  return ss.str();
}

void solve() {
  vs t = {"* = ****",
          "* =* ***",
          "* =** **",
          "* =*** *",
          "* =**** ",
          " *= ****",
          " *=* ***",
          " *=** **",
          " *=*** *",
          " *=**** "};
  int n;
  vs v(8, "     ");
  vs outs;
  while (cin >> n) {
    rep(i, 5) {
      int x = n % 10;
      rep(j, 8) v[j][4 - i] = t[x][j];
      n /= 10;
    }
    ostringstream ss;
    for (auto &s : v) ss << s << endl;
    outs.pb(ss.str());
  }
  cout << join(outs, "\n");
}

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

using namespace std;

int main() {
    int n = 0;
    int N[5] = {0};
    cin >> n;
    
    N[0] = n / 10000;
    n %= 10000;
    N[1] = n / 1000;
    n %= 1000;
    N[2] = n / 100;
    n %= 100;
    N[3] = n / 10;
    n %= 10;
    N[4] = n;
    
    for(int i = 0; i < 8; i++) {
        for (int j = 0; j < 5; j++) {
            if(i == 0) {
                if (N[j] < 5) cout << "*";
                else cout << " ";
            }
            if(i == 1) {
                if (N[j] < 5) cout << " ";
                else cout << "*";
            }
            
            if(i == 2) cout << "=";
            
            if(i == 3) {
                if (N[j] > 4) N[j] -= 5;
                if (N[j] != 0) cout << "*";
                else cout << " ";
            }
            
            if(i == 4) {
                if (N[j] != 1) cout << "*";
                else cout << " ";
            }
            
            if(i == 5) {
                if (N[j] != 2) cout << "*";
                else cout << " ";
            }
            if(i == 6) {
                if (N[j] != 3) cout << "*";
                else cout << " ";
            }
            if(i == 7) {
                if (N[j] != 4) cout << "*";
                else cout << " ";
            }
            
            if (j == 4) cout << "\n";
        }
    }
    cout << "\n";
    
    return 0;
}