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()
		}
	}
}

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

int main(void){
	int n;
	while(cin>>n){
		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])<<" ";
		cout<<endl; 
		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>
using namespace std;

int main(){
	int n,c,a,i,j;
	while(cin >> n){
		int b[8][5];
		c = 10000;
		for(i=0;i<5;i++){
			a = n/c;
			if(a<5) b[0][i] = 1;
			else b[1][i] = 1;
			b[2][i] = 2;
			if(a==0||a==5){
				for(j=4;j<8;j++){
					b[j][i] = 1;
				}
			}
			else if(a==1||a==6){
				for(j=3;j<8;j++){
					if(j==4) continue;
					b[j][i] = 1;
				}
			}
			else if(a==2||a==7){
				for(j=3;j<8;j++){
					if(j==5) continue;
					b[j][i] = 1;
				}
			}
			else if(a==3||a==8){
				for(j=3;j<8;j++){
					if(j==6) continue;
					b[j][i] = 1;
				}
			}
			else {
				for(j=3;j<7;j++){
					b[j][i] = 1;
				}
			}
			n -= c*a;
			c /= 10;
		}
		for(i=0;i<8;i++){
			for(j=0;j<5;j++){
				if(b[i][j] == 1) cout << "*";
				else if(b[i][j] == 2) cout << "=";
				else cout << " ";
			}
			cout << '\0';
		}
	}
	return 0;
}

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

using namespace std;

int main() {
	int n;
	string tama[10] = {"* = ****", "* =* ***", "* =** **", "* =*** *", "* =**** ",
					  " *= ****", " *=* ***", " *=** **", " *=*** *", " *=****"};

	while (cin >> n) {
		int a[5];
		for (int i = 4; i >= 0; i--) {
			a[4-i] = n / (int)pow(10, i);
			n = n % (int)pow(10, i);
		}
		for (int i = 0; i < 8; i++) {
			for (int j = 0; j < 5; j++) {
				cout << tama[a[j]][i];
			}
			cout << endl;
		}
		cout << endl;
	}
	return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <cstdio>
#include <climits>
#include <complex>
#include <cstdint>
#include <tuple>

#define M_PI       3.14159265358979323846

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
inline int readInt() { int x; scanf("%d", &x); return x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
struct Edge {
    int to, cost;
    Edge(int to, int cost): to(to), cost(cost) {}
};

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<Edge>> AdjList;
AdjList graph;

const int INF = 100000000;

int main() {
    //cout << fixed << setprecision(15);

    vector<string> v;
    v.push_back("* = ****");
    v.push_back("* =* ***");
    v.push_back("* =** **");
    v.push_back("* =*** *");
    v.push_back("* =**** ");
    v.push_back(" *= ****");
    v.push_back(" *=* ***");
    v.push_back(" *=** **");
    v.push_back(" *=*** *");
    v.push_back(" *=**** ");
    
    string n;
    int cnt=0;
    while(cin >> n){
        if(cnt) cout << endl;
        cnt++;
        while(n.size()!=5){
            n = '0' + n;
        }
        if(n.size()==5){
            for(int i=0; i<8; ++i){
                string t = "";
                for(int j=0; j<n.size(); ++j){
                    int num = n[j]-'0';
                    t += v[num][i];
                    
                }
                cout << t << endl;
            }
        }
    }
    return 0;
}

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

int main()
{
	char s[5];
	string list[10];
	bool flag = true;
	
	list[0] = "* = ****";
	list[1] = "* =* ***";
	list[2] = "* =** **";
	list[3] = "* =*** *";
	list[4] = "* =**** ";
	list[5] = " *= ****";
	list[6] = " *=* ***";
	list[7] = " *=** **";
	list[8] = " *=*** *";
	list[9] = " *=**** ";
	
	while(scanf("%s", s) != EOF){
		if(!flag) puts("");
		string str = s;
		int len = str.size();
		string num;
		for(int i = 0; i < 5 - len; i++){
			num += "0";
		}
		num += str;
		
		for(int i = 0; i < 8; i++){
			for(int j = 0; j < 5; j++){
				cout << list[num[j] - '0'][i];
			}
			puts("");
		}
		flag = false;
	}
	
	return(0);
}

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

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef complex<double> Point;

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

		char num[8];
		sprintf(num, "%05d", a);
		rep(i, 5)
			num[i] -= '0';
		
		rep(i, 5)
			putchar(num[i]<5 ? '*' : ' ');
		puts("");
		rep(i, 5)
			putchar(5<=num[i] ? '*' : ' ');
		puts("");
		rep(i, 5)
			putchar('=');
		puts("");
		
		rep(i, 5){
			rep(j, 5)
				putchar(num[j]%5 == i ? ' ' : '*');
			puts("");
		}
	}

	return 0;
}