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 <stdio.h>
#include <utility>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
string num[10]={
	"* = ****",
	"* =* ***",
	"* =** **",
	"* =*** *",
	"* =**** ",
	" *= ****",
	" *=* ***",
	" *=** **",
	" *=*** *",
	" *=**** ",
};
int main()
{
    int n;
	int a[5];
	bool first=true;
	while(cin>>n){
		if(!first)cout<<endl;
		a[0]=n/10000;
		a[1]=(n/1000)%10;
		a[2]=(n/100)%10;
		a[3]=(n/10)%10;
		a[4]=n%10;
		for(int i=0;i<8;i++){
			for(int j=0;j<5;j++){
				cout<<num[a[j]][i];
			}
			cout<<endl;
		}
		first=false;
	}
    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=str.size()-1;i>=0;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]);

		reverse(res.begin(),res.end());
		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;
	}
}

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;
	bool fir=true;
	while(cin >> s)
	{
		if(fir)fir=false;
		else cout << endl;
		string base;
		int sz=s.size();
		for(int i=0;i<5-sz;i++)base+='0';
		base+=s;
		print(base);
	}
	return 0;
}

C++: #include <bits/stdc++.h>
 
using namespace std;
 
string str[10], in;
 
void init(){
    str[0] = "* = ****";
    str[1] = "* =* ***";
    str[2] = "* =** **";
    str[3] = "* =*** *";
    str[4] = "* =**** ";
    str[5] = " *= ****";
    str[6] = " *=* ***";
    str[7] = " *=** **";
    str[8] = " *=*** *";
    str[9] = " *=**** ";
}
 
void solve(string s, int count)
{
    if (count) cout << endl;
 
    int len = (int)s.size();
    string ans[5];  
 
    if (len == 5) {
	for (int i = 0; i < len; i++) {
	    ans[i] = str[s[i]-'0'];
        }
    } else {
	for (int i = 0; i < 5-len; i++) {
	    ans[i] = str[0];
	}
   
	int t = 0;
	for (int i = 5-len; i < 5; i++) {
	    ans[i] = str[s[t++]-'0'];
        }
    }
 
    for (int i = 0; i < 8; i++) {
	for (int j = 0; j < 5; j++) {
	    cout << ans[j][i];
	}
	cout << endl;
    }
}
 
int main()
{
    init();
    int count = 0;
    while (cin >> in) {
	solve(in, count);
	count++;
    }
    return 0;
}

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

int main()
{
	char abacus[8][10] = {
		"*****     ",
		"     *****",
		"==========",
		" **** ****",
		"* **** ***",
		"** **** **",
		"*** **** *",
		"**** **** ",
	};
	
	int n;
	while (cin >> n){
		int num[5];
		char a[8][5];
		for (int i = 0; i < 5; i++){
			num[4 - i] = n % 10;
			n /= 10;
		}
		for (int i = 0; i < 8; i++){
			for (int j = 0; j < 5; j++){
				a[i][j] = abacus[i][num[j]];
			}
		}
		for (int i = 0; i < 8; i++){
			for (int j = 0; j < 5; j++){
				cout << a[i][j];
			}
			cout << endl;
		}
		cout << endl;
	}
	
	return (0);
}

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

int main()
{
	char s[5];
	string list[10];
	
	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){
		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("");
		}
		puts("");
	}
	
	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[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++: #include<stdio.h>

int main(void){
	int n,i,j,k=0;
	int joudan[5],gedan[5];
	int data[7][5];

	while(scanf("%d",&n)!=EOF){
		for(i=0;i<7;i++)
			for(j=0;j<5;j++)
				data[i][j]=1;

		for(i=4;i>=0;i--){
			joudan[i]=(n%10)/5;
			gedan[i]=(n%10)%5;
			n/=10;
		}
		  for(i=0;i<5;i++){//上段の判定
			  if(joudan[i]==1)
				  data[0][i]=0;
			  else 
				  data[1][i]=0;
		  }

		 for(i=0;i<5;i++){//下段の判定
			  if(gedan[i]==0)
				 data[2][i]=0;
			  else if(gedan[i]==1)
				  data[3][i]=0;
			  else if(gedan[i]==2)
				  data[4][i]=0;
			  else if(gedan[i]==3)
				  data[5][i]=0;
			  else if(gedan[i]==4)
				  data[6][i]=0;
		  }
		for(i=0;i<2;i++)
			for(j=0;j<5;j++){
				if(data[i][j]==1)
					printf("*");
				else
					printf(" ");
				if(j==4) printf("\n");
			}

		for(i=0;i<5;i++){
			printf("=");
			if(i==4) printf("\n");
		}

		for(i=2;i<7;i++)
			for(j=0;j<5;j++){
				if(data[i][j]==1)
					printf("*");
				else
					printf(" ");
				if(j==4) printf("\n");
			}
	}
	return 0;
}