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>

using namespace std;
string so[10]=
  {
    "* = ****",
    "* =* ***",
    "* =** **",
    "* =*** *",
    "* =**** ",
    " *= ****",
    " *=* ***",
    " *=** **",
    " *=*** *",
    " *=**** "
  };

int main() {
  string s;
  char start[8][6] = {
    "*****",
    "     ",
    "=====",
    "     ",
    "*****",
    "*****",
    "*****",
    "*****"
  };
  
  char grid[8][6];
  bool blink = 0;
  while(cin >> s) {
    if(blink) cout << endl;
    blink = 1;
    for(int i=0; i<8; i++)
      for(int j=0; j<6; j++)
	grid[i][j] = start[i][j];
    
    int const size = s.size();
    int const OFFSET = 5-s.size();
    
    for(int j=0; j<5-OFFSET; j++)
      for(int i=0; i<8; i++)
	grid[i][j+OFFSET] = so[(int)(s[j]-'0')][i];
    
    for(int i=0; i<8; i++) {
      cout << grid[i] << endl;
    }
  }
  
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
	v.assign(a,vector<T>(b,t));
}

//v.erase(unique(v.begin(),v.end()),v.end());

string a="**=*****";
int main(){
	int n;
	bool f=true;
	while(cin>>n){
		if(!f) cout<<endl;
		f=false;
		stringstream ss[8];
		int b=10000;
		rep(i,5){
			int t=n/b;
			n%=b;
			b/=10;
			string ans=a;
			if(t>4) ans[0]=' ';
			else ans[1]=' ';
			ans[3+t%5]=' ';
			rep(j,8){
				ss[j]<<ans[j];
			}
		}
		// cout<<"hoge\n";
		rep(i,8){
			string tmp;
			getline(ss[i],tmp);
			cout<<tmp<<endl;
		}
		// cout<<endl;
	}
}

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;
    while(cin >> input){
        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;
        }
        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];

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

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

char y=str[i-t];


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

for(int j=0;j<9;j++){

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

}
	
}

for(int i=0;i<8;i++){
for(int j=0;j<5;j++)
cout<<ch[i][j];

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

C++: #include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
main(){
  int i=0;
  string s;
  while(cin>>s){
    string t[8];
    r(ii,5){
      r(j,8){
        if(j==2)t[j]+='=';
        else t[j]+='*';
      }
    }
    for(i=0;i<5-s.size();i++)
      t[1][i]=t[3][i]=' ';
    for(;i<5;i++){
      int p=s[i-(5-s.size())]-'0';
      if(p==0)t[1][i]=t[3][i]=' ';
      if(p==1)t[1][i]=t[4][i]=' ';
      if(p==2)t[1][i]=t[5][i]=' ';
      if(p==3)t[1][i]=t[6][i]=' ';
      if(p==4)t[1][i]=t[7][i]=' ';
      if(p==5)t[0][i]=t[3][i]=' ';
      if(p==6)t[0][i]=t[4][i]=' ';
      if(p==7)t[0][i]=t[5][i]=' ';
      if(p==8)t[0][i]=t[6][i]=' ';
      if(p==9)t[0][i]=t[7][i]=' ';
    }
    r(ii,8)cout<<t[ii]<<endl;
  }
}

C++: #include<iostream>
#include<string>
using namespace std;
string s[10]={"* = ****","* =* ***","* =** **","* =*** *","* =**** "," *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "};
int main(){
	string d;
	int c[5];
	bool first=true;
	while(cin>>d){
		if(!first)cout<<endl;
		first=false;
		for(int i=0;i<5;i++)c[i]=0;
		for(int i=0;i<d.size();i++)c[5-d.size()+i]=d[i]-'0';
		for(int i=0;i<8;i++){for(int j=0;j<5;j++)cout<<s[c[j]][i];cout<<endl;}
	}
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <complex>
#include <fstream>
#include <iomanip>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }

int main()
{
	string str;
	int flag = 0;
	while(cin >> str)
	{
		if(flag++ != 0) cout << endl;
		deque<string> res;

		rep(i, 5)
		{
			if(str.size() <= i)
				res.push_front("* = ****");
			else
			{
				if(str[i] - '0' < 5)
					res.push_back("* =");
				else
				{
					str[i] -= 5;
					res.push_back(" *=");
				}

				rep(j, str[i] - '0')
					res[i] += "*";

				res[i] += " ";

				rep(j, 5 - (str[i] - '0' + 1))
					res[i] += "*";
			}
		}

		rep(i, 8) rep(j, 5)
			cout << res[j][i] << (j == 4 ? "\n" : "");
	}
}