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<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<cstdlib>
#include<iomanip>
#include<queue>
#include<set>
#include <valarray>
#include<stack>
#include<sstream>
using namespace std;

void Solution()
{
    bool flag = false;
    
    string s;
    string ans[10] =
    {
        "* = ****",
        "* =* ***",
        "* =** **",
        "* =*** *",
        "* =**** ",
        " *= ****",
        " *=* ***",
        " *=** **",
        " *=*** *",
        " *=**** "
    };
    
    while(cin>>s)
    {
        if(flag)
        {
            cout << endl;
        }
        else
        {
            flag = true;
        }
        
        while(s.size() < 5)
        {
            s = '0' + s;
        }
        
        for(int i = 0; i < 8; i++)
        {
            for(int j = 0; j < 5; j++)
            {
                cout << ans[s[j] - '0'].at(i);
            }
            
            cout << endl;
        }
    }
}

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

C++: #include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int n;
string res[8];
/*
 0123456789
0*****     
1     *****
2==========
3 **** ****
4* **** ***
5** **** **
6*** **** *
7**** **** 
*/
int main() {
    while (scanf("%d",&n)!=EOF) {
        fill(res, res+8, "");
        res[2]="=====";
        int ten=10000;
        for (int i=0; i<5; i++) {
            int x=n/ten;
            n%=ten;
            ten/=10;
            if (0<=x&&x<=4) {
                res[0]+='*';
                res[1]+=' ';
            } else {
                res[0]+=' ';
                res[1]+='*';
            }
            if (x==0||x==5) res[3]+=' ';
            else res[3]+='*';
            if (x==1||x==6) res[4]+=' ';
            else res[4]+='*';
            if (x==2||x==7) res[5]+=' ';
            else res[5]+='*';
            if (x==3||x==8) res[6]+=' ';
            else res[6]+='*';
            if (x==4||x==9) res[7]+=' ';
            else res[7]+='*';
        }
        for (int i=0; i<8; i++) cout << res[i] << endl;
    }
}

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

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

int n;
string s;
string table[] = { "*****     ", "     *****", "==========",
" **** ****", "* **** ***", "** **** **", "*** **** *", "**** **** " };
bool f = 0;

int main(){
	while (cin >> s){
		if (f)cout << endl;
		reverse(ALL(s));
		REP(i, 4){
			if (s.size() >= 5)break;
			s += "0";
		}
		reverse(ALL(s));
		REP(i, 8){
			REP(j, s.size()){
				cout << table[i][s[j] - '0'];
			}
			cout << endl;
		}
		f = 1;
	}
}

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

int main(void){
	int n;
	bool f=false;
	while(cin>>n){
		if (f) cout<<endl;
		else f = true;
		int in[5];
		in[0] = n / 10000	% 10;
		in[1] = n / 1000	% 10;
		in[2] = n / 100		% 10;
		in[3] = n / 10	 	% 10;
		in[4] = n / 1 		% 10;
//		for(int i = 0 ;  i < 5 ; i ++)cout<<int(in[i])<<" ";
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]<5)cout<<"*";
			else cout<<" ";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]>=5){cout<<"*";in[i]-=5;}
			else cout<<" ";
		cout<<endl;
		
		for(int i = 0 ; i < 5 ; i ++)
			cout<<"=";
		cout<<endl;
		
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==0)cout<<" ";
			else cout<<"*";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==1)cout<<" ";
			else cout<<"*";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==2)cout<<" ";
			else cout<<"*";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==3)cout<<" ";
			else cout<<"*";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==4)cout<<" ";
			else cout<<"*";
		cout<<endl;
	}
}

C++: #include<iostream>
#include<cstdio>
#include<string>
using namespace std;int main(){int i,j=0;string s,l[2]={" ","*"};char x[6];while(cin>>i){if(j)cout<<endl;sprintf(x,"%05d",i);for(j=5;j-->0;)x[j]-='0';s="";while(j++<1){for(i=0;i<5;i++)s+=l[j+(x[i]<5)&1];s+="\n";}for(j=5;j-->0;)s+="=";s+="\n";while(j++<4){for(i=0;i<5;i++)s+=l[x[i]%5!=j];s+="\n";}cout<<s;}return 0;}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<string>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<cstring>
#include<stack>
#include<functional>
using namespace std;

int main(){
	string S,a[10] = {
		"* = ****",
		"* =* ***",
		"* =** **",
		"* =*** *",
		"* =**** ",
		" *= ****",
		" *=* ***",
		" *=** **",
		" *=*** *",
		" *=**** "};
	for(int ds=0; cin>>S; ds++){
		if(ds!=0) puts("");
		while(S.size()<5) S = "0"+S;
		for(int i=0;i<8;i++){
			for(int j=0;j<S.size();j++){
				printf("%c",a[S[j]-'0'][i]);
			}puts("");
		}
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(int x=from;x<to;x++)
typedef long long ll;

using namespace std;


string sb( int n){
	string res = ((n>4)? " *=": "* =");
	if (n%5>3)  res += "**** ";
	else if (n%5>2)  res += "*** *";
	else if (n%5>1)  res += "** **";
	else if (n%5>0)  res += "* ***";
	else  res += " ****";
    return res;
}

int main(void){

int n;
bool pg=false;
string ss[5], sd[8];
	while(cin >> n){
		if(cin.eof()) break;
		int wk=100000;
		rep(i,5){
			int z = (n%wk )/(wk/10);
			ss[i] = sb(z);
			wk /= 10;
		}
		rep(j,8) sd[j] = "     ";
		rep(i,5) rep(j,8) sd[j][i] = ss[i][j];
		
		if(pg) cout << endl;
		//		rep(i,5)cout << ss[i] << endl;
		rep(i,8)cout << sd[i] << endl;
		pg=true;
	}
	return 0;
	
}