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<stdio.h>
#include<string>
#include<iostream>
using namespace std;

int main(){
string str;

char ch[10][6];
char n1[10]="* =* ***";
char n2[10]="* =** **";
char n3[10]="* =*** *";
char n4[10]="* =**** ";
char n5[10]=" *= ****";
char n6[10]=" *=* ***";
char n7[10]=" *=** **";
char n8[10]=" *=*** *";
char n9[10]=" *=**** ";
char n0[10]="* = ****";
char nn[10];

while(cin>>str){
int t=5-str.size();
bool f=true;

for(int i=0;i<5;i++){
	if(i<t){		
	for(int j=0;j<8;j++)
	nn[j]=n0[j];
	f=false;
}
	else{

char y=str[i-t];


if(y=='0'){
	for(int j=0;j<8;j++)
	nn[j]=n0[j];
}
else if(y=='1'){
	for(int j=0;j<8;j++)nn[j]=n1[j];
}
else if(y=='2'){
	for(int j=0;j<8;j++)nn[j]=n2[j];
}
else if(y=='3'){
	for(int j=0;j<8;j++)nn[j]=n3[j];
}
else if(y=='4'){
	for(int j=0;j<8;j++)nn[j]=n4[j];
}
else if(y=='5'){
	for(int j=0;j<8;j++)nn[j]=n5[j];
}
else if(y=='6'){
	for(int j=0;j<8;j++)nn[j]=n6[j];
}
else if(y=='7'){
	for(int j=0;j<8;j++)nn[j]=n7[j];
}
else if(y=='8'){
	for(int j=0;j<8;j++)nn[j]=n8[j];
}
else if(y=='9'){
	for(int j=0;j<8;j++)nn[j]=n9[j];
}
	if(y!='9'&&y!='4')f=false;
	}
	
for(int j=0;j<8;j++){

ch[j][i]=nn[j];

}
	
}
int w=8;
	if(f==true)w=7;
for(int i=0;i<w;i++){
for(int j=0;j<5;j++)
cout<<ch[i][j];

cout<<endl;
}
cout<<endl;
}
return 0;
}

C++: #include <iostream>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
	int digit[5];
	int view[5];
	string s;
	int c = 0;
	while(cin >> s){
		if(c++)cout << endl;
		rep(i,5)digit[i]=0;
		rep(i,s.length()){
			digit[5-s.length()+i] = s[i]-'0';
		}
		rep(i,5)
			if(digit[i]<5)cout << "*";
			else cout << " ";
		cout << endl;
		rep(i,5)
			if(digit[i]>=5)cout << "*";
			else cout << " ";
		cout << "\n=====\n";
		rep(i,5){
			view[i] = digit[i]%5;
		}
		rep(i,5){
			rep(j,5){
				if(view[j]--)cout << "*";
				else cout << " ";
			}
			cout << endl;
		}
	}
}

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;
}