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>
#include<vector>
#define p push_back
using namespace std;
vector<char> v[10];

void solve(char c){
  if(0<=c-'0' && c-'0'<=4){
    v[0].p('*');
    v[1].p(' ');
  }
  else{
    v[0].p(' ');
    v[1].p('*');
   }
  v[2].p('=');
  if(c-'0' == 0){
    v[3].p(' ');v[4].p('*');v[5].p('*');v[6].p('*');v[7].p('*');
  }
  else if(c-'0' == 1){
 
  v[3].p('*');v[4].p(' ');v[5].p('*');v[6].p('*');v[7].p('*');
  }
 else if(c-'0' == 2){
 
  v[3].p('*');v[4].p('*');v[5].p(' ');v[6].p('*');v[7].p('*');
  }
 else if(c-'0' == 3){
 
  v[3].p('*');v[4].p('*');v[5].p('*');v[6].p(' ');v[7].p('*');

  }
 else if(c-'0' == 4){
 
  v[3].p('*');v[4].p('*');v[5].p('*');v[6].p('*');v[7].p(' ');
  }
 else if(c-'0' == 5){
 
  v[3].p(' ');v[4].p('*');v[5].p('*');v[6].p('*');v[7].p('*');
  }
 else if(c-'0' == 6){
  v[3].p('*');v[4].p(' ');v[5].p('*');v[6].p('*');v[7].p('*');
  }
 else if(c-'0' == 7){
 
  v[3].p('*');v[4].p('*');v[5].p(' ');v[6].p('*');v[7].p('*');
  }
 else if(c-'0' == 8){
 
  v[3].p('*');v[4].p('*');v[5].p('*');v[6].p(' ');v[7].p('*');
  }
 else if(c-'0' == 9){
   v[3].p('*');v[4].p('*');v[5].p('*');v[6].p('*');v[7].p(' ');
  }

} 


int main(){
  string s;
  while(cin >> s){
    
    for(int i=0;i<9;i++)v[i].clear();
    for(int i=0;i<s.length();i++){
      solve(s[i]);
    }
  
    for(int i=0;i<8;i++){
      for(int j=0;j<s.length();j++){
      	cout << v[i][j];
      }
      cout << endl;
    }
  
  }
  
  
  return 0;
}

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

const int H = 8;
const int W = 5;
string s;
char G[H][W];

int main() {
  while(cin >> s) {
    while(s.size() != W) s.insert(0, "0");
    for(int i = 0; i < W; ++i) {
      int n = s[i]-'0';
      string t = "**=*****";
      t[1-n/5] = t[3+n%5] = ' ';
      for(int j = 0; j < H; ++j) {
        G[j][i] = t[j];
      }
    }
    static bool first = true;
    if(first) first = false;
    else cout << endl;
    for(int i = 0; i < H; ++i) {
      for(int j = 0; j < W; ++j) {
        cout << G[i][j];
      }
      cout << endl;
    }
  }
  return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>

using namespace std;

typedef long long ll;
typedef pair<string,int> P;

int main(){
	string str;
	string ge5[] = {"* ="," *="};
	string lt5[] = {" ****","* ***","** **","*** *", "**** "};
	bool isnl=false;
	while(getline(cin,str)){
		if(isnl) cout << endl;
		vector<string> res;

		while(str.size()<5) str = "0" + str;
		for(int i=0;i<str.size();i++){
			string tmp="";
			tmp = ge5[(str[i]-'0') >= 5 ? 1 : 0];
			tmp = tmp + lt5[(str[i]-'0') % 5];
			res.push_back(tmp);
		}

		while(res.size()<5) res.push_back(ge5[0]+lt5[0]);

		for(int i=0;i<res[0].size();i++){
			for(int j=0;j<res.size();j++){
				printf("%c%s",res[j][i],j==res.size()-1 ? "\n" : "");
			}
		}
		isnl = true;
	}

	exit(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()) {
			string ans = "";
			bool flag = true;
			rep(i, 0, 5) {
				if (flag&&s[i][h] == ' ')continue;
				flag = false;
				ans = s[i][h] + ans;
			}
			cout << ans << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
int main()
{
	char s[6], r[5][8], d;
	int n = -1, i, j, c;
	while (1)
	{
		if (cin.eof()) break;
		cin >> n;
		cout << endl;
		sprintf(s, "%05d", n);
		for (i = 0; i < 5; i++)
		{
			d = (char)s[i];
			c = atoi(&d);
			if (c < 5)
			{
				r[i][0] = '*';
				r[i][1] = ' ';
			}
			else
			{
				r[i][0] = ' ';
				r[i][1] = '*';
			}
			r[i][2] = '=';
			for (j = 3; j < 8; j++)
			{
				if (c != j-3 && c != j+2)
					r[i][j] = '*';
				else
					r[i][j] = ' ';
			}
		}
		for (i = 0; i < 8; i++)
		{
			for (j = 0; j < 5; j++)
			{
				cout << r[j][i];
			}
			cout << endl;
		}
	}
}

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

int main(void){
	int n;
	while(cin>>n){
		int in[5];
		in[0] = n / 10000	% 10;
		in[1] = n / 1000	% 10;
		in[2] = n / 100		% 10;
		in[3] = n / 10	 	% 10;
		in[4] = n / 1 		% 10;
//		for(int i = 0 ;  i < 5 ; i ++)cout<<int(in[i])<<" ";
		cout<<endl; 
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]<5)cout<<"*";
			else cout<<" ";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]>=5){cout<<"*";in[i]-=5;}
			else cout<<" ";
		cout<<endl;
		
		for(int i = 0 ; i < 5 ; i ++)
			cout<<"=";
		cout<<endl;
		
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==0)cout<<" ";
			else cout<<"*";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==1)cout<<" ";
			else cout<<"*";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==2)cout<<" ";
			else cout<<"*";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==3)cout<<" ";
			else cout<<"*";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==4)cout<<" ";
			else cout<<"*";
		cout<<endl;
		
	}
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>

typedef long long ll;

using namespace std;

int main()
{
	int n;
	while (scanf("%d", &n) != EOF)
	{
		int d[5];
		for (int i = 0 ; i < 5; ++i, n /= 10)
			d[4-i] = n % 10;

		char soro[7][5 + 1];
		memset(soro, '*', sizeof(soro));
		for (int i = 0; i < 7; ++i)
			soro[i][5] = '\0';

		for (int i = 0; i < 5; ++i)
			soro[d[i] >= 5 ? 0 : 1][i] = ' ';
		for (int i = 0; i < 5; ++i)
			soro[d[i]%5 + 2][i] = ' ';

		for (int i = 0; i < 7; ++i)
		{
			puts(soro[i]);
			if (i == 1)
				puts("=====");
		}
		putchar('\n');
	}

	return 0;
}