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>
#include <string>
#include <cstring>
#include <cmath>

using namespace std;

int main(void){
	int n;
	
	while(cin >> n){
		int d[5];
		
		for(int i=4;i>=0;i--){
			d[4-i] = (int)(n / pow(10, i)) % 10;
		}
		
		for(int i=0;i<8;i++){
			for(int j=0;j<5;j++){
				if(i == 0){
					if(d[j] / 5 == 0){
						cout << "*";
					}else{
						cout << " ";
					}
				}else if(i == 1){
					if(d[j] / 5 == 1){
						cout << "*";
					}else{
						cout << " ";
					}
				}else if(i == 2){
					cout << "=";
				}else if(i == 3){
					if(d[j] % 5 == 0){
						cout << " ";
					}else{
						cout << "*";
					}
				}else if(i == 4){
					if(d[j] % 5 == 1){
						cout << " ";
					}else{
						cout << "*";
					}
				}else if(i == 5){
					if(d[j] % 5 == 2){
						cout << " ";
					}else{
						cout << "*";
					}
				}else if(i == 6){
					if(d[j] % 5 == 3){
						cout << " ";
					}else{
						cout << "*";
					}
				}else if(i == 7){
					if(d[j] % 5 == 4){
						cout << " ";
					}else{
						cout << "*";
					}
				}
			}
			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 (cin >> n) {
		if (cnt++)cout << endl;

		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, 5) {
				cout << s[j][i];
			}
			cout << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vp;

int gcd(int a, int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int lcm(int a, int b){
    return a/gcd(a,b)*b;
}


signed main(void) {
    int n;
    bool c = false;
    while(cin >> n){
        if(c)cout << endl;
        c = true;
        vs s(8,"     ");
        rep(i,5){
            if(n%10 >= 5)s[1][4-i] = '*';
            else s[0][4-i] = '*';
            s[2][4-i] = '=';
            switch (n%5) {
                case 0: s[4][4-i] = s[5][4-i] = s[6][4-i] = s[7][4-i] = '*';break;
                case 1: s[3][4-i] = s[5][4-i] = s[6][4-i] = s[7][4-i] = '*';break;
                case 2: s[3][4-i] = s[4][4-i] = s[6][4-i] = s[7][4-i] = '*';break;
                case 3: s[3][4-i] = s[4][4-i] = s[5][4-i] = s[7][4-i] = '*';break;
                case 4: s[3][4-i] = s[4][4-i] = s[5][4-i] = s[6][4-i] = '*';break;
            }
            n /= 10;
        }
        rep(i,8)cout << s[i] << endl;
    }

}

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

int main(){
	bool f=false;
	int n,i,j;
	int a[6];
	char a0[11][10]={"* = ****","* =* ***","* =** **","* =*** *","* =**** "," *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "};
	cin>>n;
	while(n!='EOF'){
		if(f==true) 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=true;
	cin>>n;
	}
	return 0;
}

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

int main(void){
	string str;
	char aba[9][9];
	bool ch=false;
	while(cin >> str){
		if(ch==true)printf("\n");
		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");
		}
		ch=true;
	}
    return 0;
}