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

int main()
{
	char s[5];
	string list[10];
	bool flag = true;
	
	list[0] = "* = ****";
	list[1] = "* =* ***";
	list[2] = "* =** **";
	list[3] = "* =*** *";
	list[4] = "* =**** ";
	list[5] = " *= ****";
	list[6] = " *=* ***";
	list[7] = " *=** **";
	list[8] = " *=*** *";
	list[9] = " *=**** ";
	
	while(scanf("%s", s) != EOF){
		if(!flag) puts("");
		string str = s;
		int len = str.size();
		string num;
		for(int i = 0; i < 5 - len; i++){
			num += "0";
		}
		num += str;
		
		for(int i = 0; i < 8; i++){
			for(int j = 0; j < 5; j++){
				cout << list[num[j] - '0'][i];
			}
			puts("");
		}
		flag = false;
	}
	
	return(0);
}

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

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef complex<double> Point;

int main()
{
	int a;
	bool first = true;
	while(scanf("%d", &a) != EOF){
		if(!first)
			puts("");
		else
			first = false;

		char num[8];
		sprintf(num, "%05d", a);
		rep(i, 5)
			num[i] -= '0';
		
		rep(i, 5)
			putchar(num[i]<5 ? '*' : ' ');
		puts("");
		rep(i, 5)
			putchar(5<=num[i] ? '*' : ' ');
		puts("");
		rep(i, 5)
			putchar('=');
		puts("");
		
		rep(i, 5){
			rep(j, 5)
				putchar(num[j]%5 == i ? ' ' : '*');
			puts("");
		}
	}

	return 0;
}

C++: #include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;
const int L = 8;

int main() {
  string v[10];
  v[0] = "* = ****";
  v[1] = "* =* ***";
  v[2] = "* =** **";
  v[3] = "* =*** *";
  v[4] = "* =**** ";
  v[5] = " *= ****";
  v[6] = " *=* ***";
  v[7] = " *=** **";
  v[8] = " *=*** *";
  v[9] = " *=**** ";
  string s;
  bool f = false;
  while(cin >>s){
    if(f) cout <<endl;
    f = true;
    stringstream ss[L];
    while(s.length() < 5) s = "0" + s;
    REP(i, s.length()) REP(j, v[s[i] - '0'].length()) ss[j] << v[s[i] - '0'][j];
    REP(i, L) cout <<ss[i].str() <<endl;
  }
  return 0;
}

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

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

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

int main(){
  int i,j,a,b,c,con=0;
  while(cin >> a){
    if(con != 0) cout << endl;
    con++;
    for(j=0;j<=5;j+=5){
      b = a;
      for(i=10000;i>=1;i/=10){
	if(b/i == j || b/i == j+1 || b/i == j+2 || b/i == j+3 || b/i == j+4) cout << "*";
	else cout << " ";

        c = b / i;
	b = b - c * i;

      }
      cout << endl;
    }
    
    cout << "=====" << endl;
    
    for(j=0;j<5;j++){
      b = a;
      for(i=10000;i>=1;i/=10){
	if(b/i == j || b/i == j+5) cout << " ";
	else cout << "*";

	c = b / i;
	b = b - c * i;

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

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

int main() {
  int n;
  int a[5];
  bool b[5], first;
  first = true;
  while (cin >> n) {
    for (int i=0; i<5; i++) {
      a[i] = n % 10;
      n /= 10;
    }
    reverse(a, a+5);
    for (int i=0; i<5; i++) {
      if (a[i] < 5) {
        b[i] = false;
      } else {
        a[i] -= 5;
        b[i] = true;
      }
    }
    if (!first) cout << endl;
    for (int i=0; i<5; i++) cout << (b[i] ? ' ' : '*');
    cout << endl;
    for (int i=0; i<5; i++) cout << (b[i] ? '*' : ' ');
    cout << endl;
    for (int i=0; i<5; i++) cout << '=';
    cout << endl;
    for (int i=0; i<5; i++) {
      for (int j=0; j<5; j++) {
        cout << ((i == a[j]) ? ' ' : '*');
      }
      cout << endl;
    }
    first = false;
  }
  return 0;
}

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

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

int main() {
  int n, abcus[8][5], time = 0;
  while(cin >> n) {
    if(time++ > 0) cout << endl;
    char ans[8][5];
    int reed = 10000;
    int cnt = 0;
    while(cnt < 5) {
      int num = n/reed;
      for(int i = 0; i < 8; i++) {
        ans[i][cnt] = pos[num][i];
      }
      if(num > 0) n -= num * reed;
      reed /= 10;
      cnt++;
    }
    for(int i = 0; i < 8; i++) {
      for(int j = 0; j < 5; j++) {
       printf("%c", ans[i][j]);
      }
      cout << endl;
    }
  }
}

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