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()
		}
		fmt.Println()
	}
}

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

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

int main(){
	string n;
	for(int f=0;cin>>n;f++){
		if(f)cout<<endl;
		for(;n.size()<5;n="0"+n);
		for(int i=0;i<8;i++){
			for(int j=0;j<5;j++){
				int k=n[j]-'0';
				cout<<data[k][i];
			}
			cout<<endl;
		}
	}
	
	return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <fstream>
#include <sstream>
#include <math.h>
#include <queue>
#include <stack>
#include <math.h>

using namespace std;

char soroban_table[8][10]={
    '*','*','*','*','*',' ',' ',' ',' ',' ',
    ' ',' ',' ',' ',' ','*','*','*','*','*',
    '=','=','=','=','=','=','=','=','=','=',
    ' ','*','*','*','*',' ','*','*','*','*',
    '*',' ','*','*','*','*',' ','*','*','*',
    '*','*',' ','*','*','*','*',' ','*','*',
    '*','*','*',' ','*','*','*','*',' ','*',
    '*','*','*','*',' ','*','*','*','*',' '
};

/*
*****
     *****
==========
 **** ****
* **** ***
** **** **
*** **** *
**** ****
*/
int main(){
    string input;
    bool flag = true;
    while(cin >> input){
        if(flag)flag=false;
        else cout<<endl;
        
        while(input.length()<5){
            input='0'+input;
        }
        for(int i=0; i<8; i++){
            for(int j=0; j<input.length(); j++){
                cout<<soroban_table[i][input[j]-'0'];
            }
            cout<<endl;
        }
        
    }
}

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++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <ctype.h>
#include <string>
#include <iostream>
#include <vector>
#include <stack>
#include <fstream>
#include <sstream>
#include <queue>
#include <exception>
#include <cmath>
#include <numeric>
#include <map>
#include <algorithm>
#include <bitset>
#include <set>
#include <functional>

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

using namespace std;
typedef long long int lint;

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

bool AOJ0128()
{
	int n;
	if (!(cin >> n)) return false;

	char pic[8][5] = { 0 };
	RREP(j, 5) {
		int m = n % 10;
		REP(i, 8) {
			pic[i][j] = abacus[m][i];
		}
		n /= 10;
	}

	REP(i, 8) {
		REP(j, 5) {
			cout << pic[i][j];
		}
		cout << endl;
	}

	return true;
}

int main()
{
	while (AOJ0128()) {
		cout << endl;
	}

	return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,s,b) for(int i=(s);i<(b);i++)
#define rrep(i,s,b) for(int i=(b)-1;i>=(s);i--)
#define all(s) (s).begin(),(s).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

signed main() {
	for (int n, cnt = 0; cin >> n; cnt++) {
		if (cnt)cout << endl;
		string s[5] = {};
		rep(i, 0, 5) {
			int a = n % 10;
			if (a > 5)s[i] += " *=";
			else s[i] += "* =";
			a %= 5;
			rep(j, 0, 5) {
				if (j == a) s[i] += " ";
				s[i] += "*";
			}
			n /= 10;
		}
		rep(h, 0, s[0].size()) {
			rrep(i, 0, 5) {
				cout << s[i][h];
			}
			cout << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,s,b) for(int i=(s);i<(b);i++)
#define rrep(i,s,b) for(int i=(b)-1;i>=(s);i--)
#define all(s) (s).begin(),(s).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

signed main() {
	for (int n; cin >> n;) {
		string s[5] = {};
		rep(i, 0, 5) {
			int a = n % 10;
			if (a > 5)s[i] += " *=";
			else s[i] += "* =";
			a %= 5;
			rep(j, 0, 5) {
				if (j == a) s[i] += " ";
				s[i] += "*";
			}
			n /= 10;
		}
		rep(h, 0, s[0].size()) {
			rrep(i, 0, 5) {
				cout << s[i][h];
			}
			cout << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include <string>
using namespace std;
 
int main(){
    string s;
    string soro[10] = {"* = ****",
                        "* =* ***",
                        "* =** **",
                        "* =*** *",
                        "* =**** ",
                        " *= ****",
                        " *=* ***",
                        " *=** **",
                        " *=*** *",
                        " *=**** "};
    bool flag = true;
    while(cin >> s){
        vector<char> c;
        for(int i=0;i<s.size();i++){
            c.push_back('0');
        }
        for(int i=0;i<s.size();i++){
            c.push_back(s[i]);
        }
        if(flag){
            flag = false;
        }else{
            cout << endl;
        }
 
        for(int i=0;i<8;i++){
            for(int j=0;j<5;j++){
                cout << soro[c[j]-'0'][i];
            }
            cout << endl;
        }
    }
    return 0;
}