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 <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++) {
				if (tama[a[j]][i] == ' ') {
					bool hantei = false;
					for (int k = j+1; k < 5; k++) {
						if (tama[a[k]][i] != ' ') {
							hantei = true;
							break;
						}
					}
					if (hantei) {
						cout << tama[a[j]][i];
					} else {
						break;
					}
				} else {
					cout << tama[a[j]][i];
				}
			}
			cout << endl;
		}
		cout << endl;
	}
	return 0;
}

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

int main(void){
	string str;
	char aba[9][9];
	while(cin >> str){
		string str2;
		for(int i=str.size();i<5;i++){
			str2+="0";
		}
		str2+=str;
		memset(aba,'\0',sizeof(aba));
		for(int i=0;i<str2.size();i++){
			if(str2[i]<'5')aba[i][0]='*',aba[i][1]=' ';
			else aba[i][0]=' ',aba[i][1]='*';
			aba[i][2]='=';
			for(int j=3;j<8;j++){
				if(j-3==(str2[i]-'0')%5)aba[i][j]=' ';
				else aba[i][j]='*';
			}
		}
		for(int i=0;i<8;i++){
			for(int j=0;j<str2.size();j++){
				printf("%c",aba[j][i]);
			}
			printf("\n");
		}
	}
    return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>

typedef long long ll;

using namespace std;

int main()
{
	int n;
	while (scanf("%d", &n) != EOF)
	{
		int d[5];
		for (int i = 0 ; i < 5; ++i, n /= 10)
			d[4-i] = n % 10;

		char soro[7][5 + 1];
		memset(soro, '*', sizeof(soro));
		for (int i = 0; i < 7; ++i)
			soro[i][5] = '\0';

		for (int i = 0; i < 5; ++i)
			soro[d[i] >= 5 ? 0 : 1][i] = ' ';
		for (int i = 0; i < 5; ++i)
			soro[d[i] + 2][i] = ' ';

		for (int i = 0; i < 7; ++i)
		{
			puts(soro[i]);
			if (i == 1)
				puts("=====");
		}
		putchar('\n');
	}

	return 0;
}

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

template<class T, class U> T lexical_cast(const U& from)
{ T to; stringstream ss; ss << from; ss >> to; return to; }

int get(int n, int index) {
    char buf[16];
    sprintf(buf, "%05d", n);
    string s = lexical_cast<string>(buf);
    return s[4 - index] - '0';
}

const char bit[10] = {
    0b01111001,
    0b01110101,
    0b01101101,
    0b01011101,
    0b00111101,
    0b01111010,
    0b01110110,
    0b01101110,
    0b01011110,
    0b00111110
};

char board[5];

int main() {
    bool first = true;
    for(int num; cin >> num; ) {
        if(first == false) putchar('\n');
        else first = false;

        for(int i = 0; i < 5; i++) {
            board[i] = bit[get(num, i)];
        }
        for(int row = 0; row < 7; row++) {
            for(int i = 4; i >= 0; i--) {
                putchar((board[i] & (1 << row)) ? '*' : ' ');
            }
            putchar('\n');
            if(row == 1) puts("=====");
        }
    }
}

C++: #include<iostream>
using namespace std;
int main() {
	int a;
	bool b00l = true;
	while (cin >> a){
		if (!b00l)cout << endl;
		int b[5] = { 0 };
		if (a < 10){
			b[4] = a;
		}
		else if (a < 100){
			b[4] = a % 10;
			a -= b[4];
			a /= 10;
			b[3] = a;
		}
		else if (a < 1000){
			b[4] = a % 10;
			a -= b[4];
			a /= 10;
			b[3] = a % 10;
			a -= b[3];
			a /= 10;
			b[2] = a;
		}
		else if (a < 10000){
			b[4] = a % 10;
			a -= b[4];
			a /= 10;
			b[3] = a % 10;
			a -= b[3];
			a /= 10;
			b[2] = a % 10;
			a -= b[2];
			a /= 10;
			b[1] = a;
		}
		else{
			b[4] = a % 10;
			a -= b[4];
			a /= 10;
			b[3] = a % 10;
			a -= b[3];
			a /= 10;
			b[2] = a % 10;
			a -= b[2];
			a /= 10;
			b[1] = a % 10;
			a -= b[1];
			a /= 10;
			b[0] = a;
		}
		for (int i = 0; i < 5; i++){
			if (b[i] < 5)cout << '*';
			else cout << ' ';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			if (b[i] < 5)cout << ' ';
			else cout << '*';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			cout << '=';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			if (b[i] % 5 == 0)cout << ' ';
			else cout << '*';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			if (b[i] % 5 == 1)cout << ' ';
			else cout << '*';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			if (b[i] % 5 == 2)cout << ' ';
			else cout << '*';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			if (b[i] % 5 == 3)cout << ' ';
			else cout << '*';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			if (b[i] % 5 == 4)cout << ' ';
			else cout << '*';
		}
		cout << endl;
		b00l = false;
	}

}

C++: #include<iostream>
#include<string>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

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

int main(){
	string s;
	int cnt=0;
	while(cin>>s){
		if(cnt>0)cout<<endl;
		if(s.size()<5){
			while(s.size()<5){
				s='0'+s;
			}
		}
		rep(i,8){
			string temp="";
			rep(j,s.size()){
				temp+=num[s[j]-'0'][i];
			}
			cout<<temp<<endl;
		}
		cnt++;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstring>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

string s5[2];
string s[5];
string bar;

const int FIVE = 0, N = 5;

int main()
{
    int n, k;
    bool sec = false;
    bar = "=====";

    while(cin >> n)
    {
        REP(5) s[i] = "*****";
        REP(2) s5[i] = "*****";
        REP(5)
        {
            k = n % 10;
            if(k >= 5) { s5[FIVE][N - i - 1] = ' '; k -= 5;}
            else {s5[!FIVE][N - i - 1] = ' ';}

            s[k][N - i - 1] = ' ';
            
            n = n / 10;
        }
        if(sec) cout << endl;

        REP(2) cout << s5[i] << endl;
        cout << bar << endl;
        REP(5) cout << s[i] << endl;
        sec = true;

    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
    string N;
    bool flag = false;
    while (cin >> N) {
        if (flag) cout << enld;
        flag = true;
        while (N.size() < 5) N = "0" + N;
        vector<string> s(8);
        s[2] = "=====";

        for (int i = 0; i < N.size(); i++) {
            int n = N[i] - '0';
            if (n > 4) {
                s[1] += '*';
                s[0] += ' ';
            } else {
                s[0] += '*';
                s[1] += ' ';
            }

            int p;
            if (n >= 5) p = n - 5;
            else p = n;
            for (int j = 0; j < p; j++) {
                s[3+j] += "*";
            }

            s[3+p] += ' ';

            for (int j = 4+p; j < 8; j++) {
                s[j] += '*';
            }
        }

        for (auto i : s) cout << i << endl;
    }

    return 0;
}