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

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;
}

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;
		cout<<endl;
	}
}

C++: #include<iostream>
using namespace std;
string s[]={
	"* = ****",
	"* =* ***",
	"* =** **",
	"* =*** *",
	"* =**** ",
	" *= ****",
	" *=* ***",
	" *=** **",
	" *=*** *",
	" *=**** ",
};
main()
{
    int cnt=0;
	string t;
	while(cin>>t)
	{
	    if(cnt++>0)cout<<endl;
		for(int i=0;i<8;i++)
		{
			for(int j=0;j<t.size();j++)
			{
				cout<<s[t[j]-'0'][i];
			}
			cout<<endl;
		}
	}
}

C++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <ctype.h>
#include <string>
#include <iostream>
#include <vector>
#include <stack>
#include <fstream>
#include <sstream>
#include <queue>
#include <exception>
#include <cmath>
#include <numeric>
#include <map>
#include <algorithm>
#include <bitset>
#include <set>
#include <functional>

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

using namespace std;
typedef long long int lint;

string abacus[] = { "* = ****","* =* ***","* =** **","* =*** *","* =**** "," *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** " };

bool AOJ0128(bool flag)
{
	int n;
	if (!(cin >> n)) return false;

	char pic[8][5] = { 0 };
	RREP(j, 5) {
		int m = n % 10;
		REP(i, 8) {
			pic[i][j] = abacus[m][i];
		}
		n /= 10;
	}

	if (flag) cout << endl;

	REP(i, 8) {
		REP(j, 5) {
			cout << pic[i][j];
		}
		cout << endl;
	}

	return true;
}

int main()
{
	bool flag = false;
	while (AOJ0128(flag)) {
		flag = true;
	}

	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main() {
	string s, ans[10] = {
		"* = ****",
		"* =* ***",
		"* =** **",
		"* =*** *",
		"* =**** ",
		" *= ****",
		" *=* ***",
		" *=** **",
		" *=*** *",
		" *=**** "
	};
	while(cin >> s) {
		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;
		}
		cout << endl;
	}
}

C++: #include <iostream>
using namespace std;
int main(){
	string s;
	while(cin >> s){
		string soroban[8];
		int n[5]={0};
		for(int i=0;i<8;++i)soroban[i]="";
		for(int i=5-s.size();i<5;++i)if('0'<=s[i-(5-s.size())]&&s[i-(5-s.size())]<='9')n[i]=s[i-(5-s.size())]-'0';
		for(int i=0;i<5;++i){
			soroban[0]+=(n[i]/5)?' ':'*';
			soroban[1]+=(n[i]/5)?'*':' ';
			soroban[2]+='=';
			for(int j=0;j<5;++j) soroban[3+j]+=(n[i]%5==j)?' ':'*';
		}
		for(int i=0;i<8;++i)cout << soroban[i] << "\n";
	}
	return 0;
}

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;
		}
	}
    return 0;
}

C++: #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
const double EPS = 1e-10;

signed main() {
	string s;
	while (cin >> s) {
		while (s.size() < 5)s = "0" + s;
		vector<string>v(8, "     ");
		v[2] = "=====";
		rep(i, 0, 5) {
			rep(j, 0, 8) {
				switch (j)
				{
				case 0:
					if ('0' <= s[i] && s[i] <= '4')v[j][i] = '*';
					break;
				case 1:
					if ('5' <= s[i] && s[i] <= '9')v[j][i] = '*';
					break;
				case 2:
					break;
				case 3:
					if (s[i] != '0'&&s[i] != '5')v[j][i] = '*';
					break;
				case 4:
					if (s[i] != '1'&&s[i] != '6')v[j][i] = '*';
					break;
				case 5:
					if (s[i] != '2'&&s[i] != '7')v[j][i] = '*';
					break;
				case 6:
					if (s[i] != '3'&&s[i] != '8')v[j][i] = '*';
					break;
				case 7:
					if (s[i] != '4'&&s[i] != '9')v[j][i] = '*';
					break;
				default:
					break;
				}
			}
		}
		rep(i, 0, 8)cout << v[i] << endl;
	}
	return 0;
}