Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	table := [10]string{
		"* = ****",
		"* =* ***",
		"* =** **",
		"* =*** *",
		"* =**** ",
		" *= ****",
		" *=* ***",
		" *=** **",
		" *=*** *",
		" *=**** ",
	}
	input := make([]string, 0)
	for scanner.Scan() {
		input = append(input, scanner.Text())
	}
	n := len(input)
	cnt := 0
	for cnt < n {
		tmp := strings.Split(fmt.Sprintf("%05s", input[cnt]), "")
		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()
		}
		if cnt != n-1 {
			fmt.Println()
		}
		cnt++
	}
}

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

using namespace std;

void solve()
{
	vector<string> abacus(10);
	abacus[0] = "* = ****";
	abacus[1] = "* =* ***";
	abacus[2] = "* =** **";
	abacus[3] = "* =*** *";
	abacus[4] = "* =**** ";
	abacus[5] = " *= ****";
	abacus[6] = " *=* ***";
	abacus[7] = " *=** **";
	abacus[8] = " *=*** *";
	abacus[9] = " *=**** ";
	bool first = true;
	string input;
	while(cin >> input)
	{
		if(!first)
		{
			cout << endl;
		}
		first = false;
		string str;
		if(input.size() < 5)
		{
			for(int i = 0; i < 5 - input.size(); ++i)
			{
				str += "0";
			}
			str += input;
		}
		vector<string> data(5);
		for(int i = 0; i < str.size(); ++i)
		{
			data[i] = abacus[str[i] - '0'];
		}
		for(int i = 0; i < 8; ++i)
		{
			for(int j = 0; j < 5; ++j)
			{
				cout << data[j][i];
			}
			cout << endl;
		}
	}
}

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

C++: # define _CRT_SECURE_NO_WARNINGS 1
# include <iostream>
# include <string>
# include <bitset>
# include <vector>
# include <algorithm>
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iomanip>
# include <queue>
# include <sstream>
# include <climits>
# include <cmath>
# include <list>
# include <functional>
# include <string>
# include <ctime>
# include <set>
# include <map>
# include <stack>
# include <unordered_map>
using namespace std;
//# define M_PI 3.141592
# define INF ((int)(1<<30))
# define FOR(i,n) for(int i=0;i<(int)n;i++)
# define FORI(i,k,n) for(int i=k;i<(int)n;i++)
# define toRad 2.0*M_PI/360.0
# define inin(x) int x;cin>>x;
# define all(x) x.begin(),x.end()
# define debug(x) cout<<#x<<" :"<<x<<endl;
# define rep(i,n) for(int i=0;i<(int)n;i++)
# define EPS 1e-12
# define CHECK(i,a) FOR(i,a.size())cout<<#a<<"["<<i<<"] : "<<a[i]<<endl; 

int main()
{
	string s;
	bool f = false;
	while (cin >> s)
	{
		if (f)cout << endl;
		reverse(all(s));
		while (s.size() < 5)s += '0';
		reverse(all(s));
		f = true;
		for (int i = 0; i < s.size(); i++)
		{
			char c = '*';
			if (s[i] >= '5')
				c = ' ';
			cout << c;
		}cout << endl;
		for (int i = 0; i < s.size(); i++)
		{
			char c = ' ';
			if (s[i] >= '5')
				c = '*';
			cout << c;
		}cout << endl;
		for (int i = 0; i < s.size(); i++)
		{
			cout << '=';
		}cout << endl;

		for (int j = 0; j < 5; j++)
		{
			for (int i = 0; i < s.size(); i++)
			{
				char c = '*';
				if (s[i] == '0' + j || s[i] == '5' + j)
					c = ' ';
				cout << c;
			}cout << endl;
		}



	}

}

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;
}

C++: #include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdlib>

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

using namespace std;


int main()
{
	string s;
	string soro[10] = {"* = ****","* =* ***","* =** **","* =*** *","* =**** "," *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "};
	bool flag = true;
	while(cin >> s)
	{
		vector<char> c;

		rep(i,5-s.size())
		{
			c.push_back('0');
		}

		rep(i,s.size())
		{
			c.push_back(s[i]);
		}

		if(flag)
		{
			flag = false;
		}
		else
		{
			cout << endl;
		}

		rep(i,8)
		{
			rep(j,5)
			{
				cout << soro[c[j]-'0'][i];
			}
			cout << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<bitset>
#include<functional>
#include<climits>
using namespace std;
typedef pair<int,int>pii;
const int INF=1e9;
const int dx[]={0,-1,0,1},dy[]={-1,0,1,0};


int main(){
    int n;
    bool flag=false;
    while(scanf("%d",&n)!=EOF){
        if(flag)puts("");
        else flag=true;

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

        for(int i=0;i<2;i++){
            for(int j=0;j<5;j++){
                if(a[j]/5==i)printf("*");
                else printf(" ");
            }
            puts("");
        }
        puts("=====");

        for(int i=0;i<5;i++){
            for(int j=0;j<5;j++){
                if(a[j]%5==i)printf(" ");
                else printf("*");
            }
            puts("");
        }
    }
    return 0;
}

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

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

int main(){
	bool f=0;
	int n,i,j;
	int a[5];
	char a0[11][10]={"* = ****","* =* ***","* =** **","* =*** *","* =**** "," *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "};
	while((cin>>n)!="EOF"){
		if(f==1) cout<<endl;
	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);
	for(i=0;i<8;i++){
		for(j=0;j<5;j++){
			cout<<a0[a[j]][i];
		}
		cout<<endl;
	}
	f=1;
	}
	return 0;
}