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>
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 << '\n';
		}
	}
	return 0;
}

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

int main(){
    int n;
    char num[5];
    char ans[8][5];
    while(cin >> n){
        sprintf(num,"%05d",n);
        for(int i=0;i<5;i++){
            ans[0][i] = '*';
            ans[1][i] = ' ';
            if(num[i] >= '5' && num[i] <= '9') swap(ans[0][i],ans[1][i]);
            ans[2][i] = '=';
            for(int j=3;j<8;j++) ans[j][i] = '*';
            ans[3+((num[i]-'0')%5)][i] = ' ';
        }
        for(int i=0;i<8;i++){
            for(int j=0;j<5;j++){
                cout << ans[i][j];
            }
            cout << endl;
        }
    }
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()

#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,a,b) for(int i=(a); i<(b); i++)

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
const int IMAX=((1<<30)-1)*2+1;
const double EPS=1e-10;
//int mod=1000000007


string s[10]={
	"* = ****",
	"* =* ***",
	"* =** **",
	"* =*** *",
	"* =**** ",
	" *= ****",
	" *=* ***",
	" *=** **",
	" *=*** *",
	" *=**** "
};



int main(){
	int n;
	//string t;
	while(cin>>n){
		for(int i=0; i<8; i++){
			string t;
			for(int j=n; j>0; j/=10){
				t+=s[(j%10)][i];
			}
			for(int j=t.size(); j<5; j++){
				t+=s[0][i];
			}
			reverse(all(t));
			cout<<t<<endl;
		}
		cout<<endl;
	}
}

C++: 
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>
#include<iterator>

#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rep(i,n) for(int i=0; i<n; i++)
#define INF (1<<20)

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, char> plc;

string str[] = { "* = ****", "* =* ***","* =** **","* =*** *",
				 "* =**** "," *= ****"," *=* ***"," *=** **",
                 " *=*** *" ,"*=**** "};

int main()
{
	int cnt = 0;
	string n;

	while (1) {
		if (cnt++)cout << endl;
		cin >>  n;

		while (n.size() < 5)n = "0" + n;

		vector<string> s(n.size());
		rep(i, n.size()) 
			s[i] = str[n[i] - '0'];
		
		rep(i, 8) {
			rep(j, n.size()) {
				cout << s[j][i];
			}
			cout << endl;
		}
	}
	return 0;
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"


int main() {
	string N;
	bool flag = false;
	while (cin >> N) {
		if (flag)cout << endl;
		flag = true;
		int num = 5 - N.size();
		for (int i = 0; i < num; ++i) {

			N.insert(N.begin(), '0');
		}
		vector<vector<int>>memo{
			{ 1,0,1,0,1,1,1,1},
			{ 1,0,1,1,0,1,1,1 },
			{ 1,0,1,1,1,0,1,1 },
			{ 1,0,1,1,1,1,0,1 },
			{ 1,0,1,1,1,1,1,0 },
			{ 0,1,1,0,1,1,1,1 },
			{ 0,1,1,1,0,1,1,1 },
			{ 0,1,1,1,1,0,1,1 },
			{ 0,1,1,1,1,1,0,1 },
			{ 0,1,1,1,1,1,1,0 },

		};
		vector<string>field(8, "     ");
		for (int i = 0; i < 5; ++i) {
			for (int j = 0; j < 8; ++j) {
				field[j][i] = j == 2 ? '=' : memo[N[i] - '0'][j] ? '*' : ' ';
			}
		}
		for (int i = 0; i < field.size(); ++i) {
			cout << field[i] << endl;
		}
	}
	return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

char s[10];
int main() {
	int n; cin >> n;
	while (1) {
		sprintf(s, "%05d", n);
		rep(i, 5) {
			if (s[i] <= '4')cout << '*';
			else cout << ' ';
		}cout << endl;
		rep(i, 5) {
			if (s[i] >= '5')cout << '*';
			else cout << ' ';
		}cout << endl;
		rep(i, 5)cout << '='; cout << endl;
		rep(i, 5) {
			rep(j, 5) {
				if ((s[j] - 48) % 5 != i)cout << '*';
				else cout << ' ';
			}
			cout << endl;
		}
		if (!(cin >> n))return 0;
		cout << endl;
	}
}

C++: #include <bits/stdc++.h>

#define reps(v, f, l) for (int v = (f), v##_ = (l); v < v##_; ++v)
#define rep(v, n) reps(v, 0, n)
#define lep(v, n) reps(v, 1, n + 1)
#define rreps(v, f, l) for (int v = (l), v##_ = (f); v >= v##_; --v)
#define rrep(v, n) rreps(v, 0, n - 1)
#define rlep(v, n) rreps(v, 1, n)
#define show_a(a, size) rep(a##_it, size) std::cout << a[a##_it] << " \n"[a##_it == a##_it_ - 1];
#define show_v(v) show_a(v, v.size())
#define debug(x) std::cerr << #x << " = " << (x) << "\n";

using namespace std;

typedef long long int lint;

static inline int in(){ int x; scanf("%d", &x); return x; }
static inline lint inl(){ lint x; scanf("%lld", &x); return x; }

int main()
{
    bool is_first = true;
    int n;
    while (~scanf("%d", &n)){
        if (is_first) is_first = false;
        else puts("");
        char snum[8];
        sprintf(snum, "%05d", n);
        rep(i, 5) printf("%c", " *"[snum[i] < '5']);
        puts("");
        rep(i, 5) printf("%c", "* "[snum[i] < '5']);
        puts("");
        puts("=====");
        rep(i, 5){
            rep(j, 5){
                printf("%c", " *"[i != (snum[j] - '0') % 5]);
            }
            puts("");
        }
    }
    return (0);
}