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<math.h>
int main(){
	int a;
	bool first=false;
	while(~scanf("%d",&a)){
		if(first)printf("\n");
		first=true;
		for(int i=0;i<5;i++){
			if(a%(int)(pow(10,5-i))/(int)(pow(10,4-i))>=5)printf("*");
			else printf(" ");
		}
		printf("\n");
		for(int i=0;i<5;i++){
			if(a%(int)(pow(10,5-i))/(int)(pow(10,4-i))<5)printf("*");
			else printf(" ");
		}
		printf("\n");
		printf("=====\n");
		for(int i=0;i<5;i++){
			for(int j=0;j<5;j++){
				if((a%(int)(pow(10,5-j))/(int)(pow(10,4-j)))%5==i)printf(" ");
				else printf("*");
			}
			printf("\n");
		}
	}
}

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

using namespace std;

char abacus[8][5];

void init() {
    for (int i = 0; i < 8; i++) {
        if (i == 2) {
            for (int j = 0; j < 5; j++) {
                abacus[i][j] = '=';
            }
        } else {
            for (int j = 0; j < 5; j++) {
                abacus[i][j] = ' ';
            }
        }
    }
}

int power(int n, int a) {
    int acc = 1;
    for (int i = 0; i < a; i++) {
        acc *= n;
    }
    return acc;
}

void set(int n) {
    for (int i = 4; 0 <= i; i--) {
        int index = 4 - i;
        int d = n / power(10, i);
//        cout << "i: " << i << endl;
//        cout << "d: " << d << endl;
        if (d < 5) {
            abacus[0][index] = '*';
            abacus[1][index] = ' ';
        } else {
            abacus[0][index] = ' ';
            abacus[1][index] = '*';
            d -= 5;
        }
        for (int j = 3; j < 8; j++) {
            abacus[j][index] = '*';
        }
        abacus[d+3][index] = ' ';
        n = n - n / power(10, i) * power(10, i);
    }
}

int main() {
    int n;
    cin >> n;
    init(); set(n);
    for (int i = 0; i < 8; i++) {
        for (int j = 0; j < 5; j++) {
            cout << abacus[i][j];
        }
        cout << endl;
    }
    while (cin >> n) {
        init();
        set(n);
        cout << endl;
        for (int i = 0; i < 8; i++) {
            for (int j = 0; j < 5; j++) {
                cout << abacus[i][j];
            }
            cout << endl;
        }
    }
    return 0;
}

C++: #include <vector>
#include <algorithm>
#include <iostream>
#include <functional>
#include <string>

using namespace std;

int main() {
    int n = 0;
    int N[5] = {0};
    cin >> n;
    
    N[0] = n / 10000;
    n %= 10000;
    N[1] = n / 1000;
    n %= 1000;
    N[2] = n / 100;
    n %= 100;
    N[3] = n / 10;
    n %= 10;
    N[4] = n;
    
    for(int i = 0; i < 8; i++) {
        for (int j = 0; j < 5; j++) {
            if(i == 0) {
                if (N[j] < 5) cout << "*";
                else cout << " ";
            }
            if(i == 1) {
                if (N[j] < 5) cout << " ";
                else cout << "*";
            }
            
            if(i == 2) cout << "=";
            
            if(i == 3) {
                if (N[j] > 4) N[j] -= 4;
                if (N[j] != 0) cout << "*";
                else cout << " ";
            }
            
            if(i == 4) {
                if (N[j] != 1) cout << "*";
                else cout << " ";
            }
            
            if(i == 5) {
                if (N[j] != 2) cout << "*";
                else cout << " ";
            }
            if(i == 6) {
                if (N[j] != 3) cout << "*";
                else cout << " ";
            }
            if(i == 7) {
                if (N[j] != 4) cout << "*";
                else cout << " ";
            }
            
            if (j == 4) cout << "\n";
        }        
    }
    
    return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main() {
	string s, ans[10] = {
		"* = ****",
		"* =* ***",
		"* =** **",
		"* =*** *",
		"* =**** ",
		" *= ****",
		" *=* ***",
		" *=** **",
		" *=*** *",
		" *=**** "
	};
	while(cin >> s) {
		cout << endl;
		while(s.size() < 5) {
			s = '0' + s;
		}
		for(int i = 0; i < 8; ++i) {
			for(int j = 0; j < 5; ++j) {
				cout << ans[s[j] - '0'].at(i);
			}
			cout << endl;
		}
	}
}

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];
bool first=true;
while(cin>>str){

	if(first==false)cout<<endl;
	first=false;
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;
}

}
return 0;
}

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

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

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

int main(){
	while (cin >> s){
		bool f = 0;
		if (f)cout << endl;
		reverse(ALL(s));
		REP(i, 4){
			s += "0";
			if (s.size() >= 5)break;
		}
		reverse(ALL(s));
		REP(i, 8){
			REP(j, s.size()){
				cout << table[i][s[j] - '0'];
			}
			cout << endl;
		}
		f = 1;
	}
}