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 <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); i++ )
#define UREP( i, m, n ) for ( unsigned int i = (unsigned int)( m ); i < (unsigned int)( n ); i++ )
#define ITER( c ) __typeof( (c).begin() )
#define IREP( c, it ) for ( ITER(c) it = (c).begin(); it != (c).end(); ++it )
#define ALL( c ) (c).begin(), (c).end()
#define PB( n ) push_back( ( n ) )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define fst first
#define snd second

const string nums[] = {
	"*****     ",
	"     *****",
	"==========",
	" **** ****",
	"* **** ***",
	"** **** **",
	"*** **** *",
	"**** **** "
};

int main()
{
	string line;
	bool first = true;

	while ( cin >> line )
	{
		if ( first )
		{
			first = false;
		}
		else
		{
			cout << endl;
		}

		vector<string> res( 8 );

		UREP( i, 0, line.length() )
		{
			REP( j, 0, 8 )
			{
				res[j] += nums[j][ line[i] - '0' ];
			}
		}

		REP( i, 0, 8 )
		{
			cout << res[i] << endl;
		}
	}


	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
    string N;
    bool flag = false;
    while (cin >> N) {
        if (flag) cout << endl;
        flag = true;
        while (N.size() < 5) N = "0" + N;
        vector<string> s(8);
        s[2] = "=====";

        for (int i = 0; i < N.size(); i++) {
            int n = N[i] - '0';
            if (n > 4) {
                s[1] += '*';
                s[0] += ' ';
            } else {
                s[0] += '*';
                s[1] += ' ';
            }

            int p;
            if (n >= 5) p = n - 5;
            else p = n;
            for (int j = 0; j < p; j++) {
                s[3+j] += "*";
            }

            s[3+p] += ' ';

            for (int j = 4+p; j < 8; j++) {
                s[j] += '*';
            }
        }

        for (auto i : s) cout << i << endl;
    }

    return 0;
}

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

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

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
bool ex[10][5];
void print(string s)
{
	for(int i=0;i<5;i++)
	{
		if(s[i]-'0'<=4)cout << '*';
		else cout << ' ';
	}
	cout << endl;
	for(int i=0;i<5;i++)
	{
		if(s[i]-'0'<=4)cout << ' ';
		else cout << '*';
	}
	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++)
		{
			int p=s[j]-'0';
			if(ex[p][i])cout << '*';
			else cout << ' ';
		}
		cout << endl;
	}
	return;
}
int main()
{
	memset(ex,true,sizeof(ex));
	int l=0,r=5;
	for(int i=0;i<5;i++)
	{
		ex[l][i]=false;
		ex[r][i]=false;
		l++;r++;
	}
	string s;
	while(cin >> s)
	{
		string base;
		int sz=s.size();
		for(int i=0;i<5-sz;i++)base+='0';
		base+=s;
		print(base);
	}
	return 0;
}

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

const int MAX = 5;

int len;
char num[6];
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[6];
  bool flag = 0;
  while(scanf("%s", dumy) != EOF) {
    
    //if(scanf("%s", dumy) == EOF) { break; flag = true; }
    //if(flag) cout << endl;
    memset(num, '#', sizeof(num));
    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] = ' ';
    }
    // cout << "OK" << endl;
    len = strlen(dumy);
    //cout << len << endl;
    len = MAX - len;
    //cout << len << endl;
    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];
    //cout << "OK" << endl;
    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;
    
    for(int i = 0 ; i < 5 ; i++) {
      for(int j = 0 ; j < 5 ; j++) {
	cout << field1[i][j];
      }
      cout << endl;
    }
    memset(num, '#', sizeof(num));
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

signed main(){
int a;
int b=0;
while(cin>>a,a){
	int k=0;
   bool s[5][7]{};
   if(b)cout<<endl;
   for(int c=10000;c!=0;c/=10,k++){
   	int d=a/c;
   	if(d>4)s[k][1]=true;
   	else s[k][0]=true;
   	for(int h=0;h<5;h++){
   		if(d%5!=h)s[k][h+2]=true;
   	}
   	a-=d*c;
   }
   for(int x=0;x<2;x++){
   	for(int y=0;y<5;y++){if(s[y][x])printf("*");else printf(" ");}
   	printf("\n");
   }
   puts("=====");
   for(int x=3;x<7;x++){
   	for(int y=0;y<5;y++){if(s[y][x])printf("*");else printf(" ");}
   	printf("\n");
   }
   b++;
}
}