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;

int charToInt(char c) {
  return (int)c - (int)'0';
}

void showSoro(string str) {
  string num = "00000";
  for(int i = 0; i < str.length(); i++) {
    num[i+5-str.length()] = str[i];
  }

  for(int i = 0; i < 5; i++) {
    if(charToInt(num[i]) >= 5) cout << ' ';
    else                       cout << '*';
  }
  cout << endl;
  for(int i = 0; i < 5; i++) {
    if(charToInt(num[i]) >= 5) cout << '*';
    else                       cout << ' ';
  }
  cout << endl;
  cout << "=====" << endl;

  for(int l = 0; l < 5; l++) {
    for(int i = 0; i < 5; i++) {
      if(charToInt(num[i]) % 5 == l) cout << ' ';
      else                           cout << '*';
    }
    cout << endl;
  }
}

int main() {
  string str;
  bool flag;
  while(cin >> str) {
    if(flag) cout << endl;
    showSoro(str);
    flag = true;
  }
  return 0;
}

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

const int MAX = 5;

int len;
char num[MAX];
char field1[MAX][MAX], field2[2][MAX];
void change(int i) {
  
  if(num[i] % 5 == 1) { field1[1][i] = ' '; field1[0][i] = '*'; }
  if(num[i] % 5 == 2) { field1[2][i] = ' '; field1[0][i] = '*'; }
  if(num[i] % 5 == 3) { field1[3][i] = ' '; field1[0][i] = '*'; }
  if(num[i] % 5 == 4) { field1[4][i] = ' '; field1[0][i] = '*'; }
  if(num[i] >= 5) { field2[0][i] = ' '; field2[1][i] = '*'; }
  
}
  
int main() {
  char dumy[MAX];
  bool flag, flag2 = 0;
  while(1/*scanf("%s", dumy) != EOF*/) {
    
    if(scanf("%s", dumy) == EOF) { break; flag = true; }
    //if(flag) cout << endl;
    memset(num, '#', sizeof(num));
    flag2 = 1;
    for(int i = 1 ; i < MAX ; i++)
      for(int j = 0 ; j < MAX ; j++) field1[i][j] = '*';
    
    for(int i = 0 ; i < MAX ; i++) field1[0][i] = ' ';

    for(int i = 0 ; i < MAX ; i++) {
      field2[0][i] = '*'; 
      field2[1][i] = ' ';
    }

    len = strlen(dumy);
    len = MAX - len;
    num[len] = dumy[0];
    if(len+1 < 5) num[len+1] = dumy[1];
    if(len+2 < 5) num[len+2] = dumy[2];
    if(len+3 < 5) num[len+3] = dumy[3];
    if(len+4 < 5) num[len+4] = dumy[4];

    for(int i = 4 ; i >= 0 ; i--) {
      if(num[i] != '#') {
	num[i] = num[i] - '0';
	change(i);
      }
    }
    
    for(int i = 0 ; i < 2 ; i++) {
      for(int j = 0 ; j < 5 ; j++) {
	cout << field2[i][j];
      }
      cout << endl;
    }
  
    cout << endl <<  "=====" << endl;
    
    for(int i = 0 ; i < 5 ; i++) {
      for(int j = 0 ; j < 5 ; j++) {
	cout << field1[i][j];
      }
      cout << endl;
    }
    cout << endl;
    //if(flag == false) cout << endl;
    memset(num, '#', sizeof(num));
  }
  return 0;
}

C++: //18
#include<iostream>

using namespace std;

int main(){
  bool ns=false;
  for(int n;cin>>n;){
    char a[8][6]={{}};
    for(int i=4;i>=0;i--,n/=10){
      int m=n%10;
      a[0][i]=(m>=5)?' ':'*';
      a[1][i]=(m>=5)?'*':' ';
      a[2][i]='=';
      for(int j=0;j<5;j++){
	a[3+j][i]=(m%5==j)?' ':'*';
      }
    }
    if(ns){
      cout<<endl;
    }
    for(int i=0;i<8;i++){
      cout<<a[i]<<endl;
    }
    ns=true;
  }
  return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
long n,i,d[5],f[5],t=0;
string s;
while(cin>>n){
for(i=4;i>=0;i--){d[i]=n%10;n/=10;}
if(t==1)cout<<endl;
s="";for(i=0;i<5;i++){if(d[i]<5)s+='*';else s+=' ';}cout<<s<<endl;
s="";for(i=0;i<5;i++){if(d[i]>4)s+='*';else s+=' ';}cout<<s<<endl;
cout<<"====="<<endl;
for(i=0;i<5;i++){d[i]%=5;f[i]=0;}
s="";for(i=0;i<5;i++){if(f[i]==1||d[i]>0)s+='*';else{s+=' ';f[i]=1;}}cout<<s<<endl;
s="";for(i=0;i<5;i++){if(f[i]==1||d[i]>1)s+='*';else{s+=' ';f[i]=1;}}cout<<s<<endl;
s="";for(i=0;i<5;i++){if(f[i]==1||d[i]>2)s+='*';else{s+=' ';f[i]=1;}}cout<<s<<endl;
s="";for(i=0;i<5;i++){if(f[i]==1||d[i]>3)s+='*';else{s+=' ';f[i]=1;}}cout<<s<<endl;
s="";for(i=0;i<5;i++){if(f[i]==1||d[i]>4)s+='*';else{s+=' ';f[i]=1;}}cout<<s<<endl;
t=1;
}
return 0;
}

C++: #include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<cstdlib>
#include<iomanip>
#include<queue>
#include<set>
#include <valarray>
#include<stack>
#include<sstream>
using namespace std;

void Solution()
{
    bool flag = false;
    
    string s;
    string ans[10] =
    {
        "* = ****",
        "* =* ***",
        "* =** **",
        "* =*** *",
        "* =**** ",
        " *= ****",
        " *=* ***",
        " *=** **",
        " *=*** *",
        " *=**** "
    };
    
    while(cin>>s)
    {
        if(flag)
        {
            cout << endl;
        }
        else
        {
            flag = true;
        }
        
        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;
        }
    }
}

int main()
{
    Solution();
    return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int n;
string res[8];
/*
 0123456789
0*****     
1     *****
2==========
3 **** ****
4* **** ***
5** **** **
6*** **** *
7**** **** 
*/
int main() {
    while (scanf("%d",&n)!=EOF) {
        fill(res, res+8, "");
        res[2]="=====";
        int ten=10000;
        for (int i=0; i<5; i++) {
            int x=n/ten;
            n%=ten;
            ten/=10;
            if (0<=x&&x<=4) {
                res[0]+='*';
                res[1]+=' ';
            } else {
                res[0]+=' ';
                res[1]+='*';
            }
            if (x==0||x==5) res[3]+=' ';
            else res[3]+='*';
            if (x==1||x==6) res[4]+=' ';
            else res[4]+='*';
            if (x==2||x==7) res[5]+=' ';
            else res[5]+='*';
            if (x==3||x==8) res[6]+=' ';
            else res[6]+='*';
            if (x==4||x==9) res[7]+=' ';
            else res[7]+='*';
        }
        for (int i=0; i<8; i++) cout << res[i] << endl;
    }
}

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;

int n;
string s;
string table[] = { "*****     ", "     *****", "==========",
" **** ****", "* **** ***", "** **** **", "*** **** *", "**** **** " };
bool f = 0;

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