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()
		}
	}
}

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

int main() {
	string sa;
	while (cin >> sa) {
		int ca = 0;
		if (ca != 0)cout << endl;
		char so[5][8];
		int a = sa.size();

		for (int i = 0;i < 5;i++) {
			for (int j = 0;j < 8;j++) {
				if (j == 1 || j == 3)so[i][j] = ' ';
				else if (j == 2) { so[i][j] = '='; }
				else so[i][j] = '*';
			}
		}
	 reverse(sa.begin(), sa.end());
	 string s = sa;

		for (int i =4;i>=5-a;i--) {
			if(s[4-i]>='5'){
				so[i][0] = ' ';
				so[i][1] = '*';
			}
			else {
				so[i][0] = '*';
				so[i][1] = ' ';
			}

			if ((s[4-i] - '0') % 5 == 0) {
				so[i][3] = ' ';
				for (int ia = 4;ia <= 7;ia++)so[i][ia] = '*';
			}
			else if ((s[4-i] - '0') % 5 == 1) {
				for (int j = 3;j <= 7;j++) {
					if (j == 4)so[i][j] = ' ';
					else { so[i][j] = '*'; }
				}
			}
			else if ((s[4-i] - '0') % 5 == 2) {

				for (int j = 3;j <= 7;j++) {
					if (j == 5)so[i][j] = ' ';
					else so[i][j] = '*';
				}
			}
			else if ((s[4-i] - '0') % 5 == 3) {
				for (int j = 3;j <= 7;j++) {
					if (j == 6)so[i][j] = ' ';
					else so[i][j] = '*';
				}
			}
			else {
				for (int j = 3;j <= 7;j++) {
					if (j == 7)so[i][j] = ' ';
					else so[i][j] = '*';
				}
			}
		}
		for (int i = 0;i < 8;i++) {
			for (int j = 0;j < 5;j++) {
				cout << so[j][i];
				if (j == 4)cout << endl;
			}
		}
		ca++;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int main(){

	string num;
	bool fi=false;
	while(cin>>num){
		if(fi)
			cout<<endl;
		fi=true;
		if(num.size()<5){
			while(num.size()<5){
				num='0'+num;
			}
		}
		for(int i = 0; i < 5; i++){
			if(num[i]>='5'){
				cout<<' ';
			}
			else
				cout<<'*';
		}
		cout<<endl;
		for(int i = 0; i < 5; i++){
			if(num[i]>='5'){
				cout<<'*';
			}
			else
				cout<<' ';
		}
		cout<<endl;
		for(int i = 0; i < 5; i++){
			cout<<'=';
		}
		cout<<endl;

		for(int i = 0; i < 5; i++){
			if(num[i]!='0'&&num[i]!='5'){
				cout<<'*';
			}
			else
				cout<<' ';
		}
		cout<<endl;
		for(int i = 0; i < 5; i++){
			if(num[i]!='1'&&num[i]!='6')
				cout<<'*';
			else
				cout<<' ';
		}
		cout<<endl;
		for(int i = 0; i < 5; i++){
			if(num[i]!='2'&&num[i]!='7')
				cout<<'*';
			else
				cout<<' ';
		}
		cout<<endl;
		for(int i = 0; i < 5; i++){
			if(num[i]!='3'&&num[i]!='8')
				cout<<'*';
			else
				cout<<' ';
		}
		cout<<endl;
		for(int i = 0; i < 5; i++){
			if(num[i]!='4'&&num[i]!='9')
				cout<<'*';
			else
				cout<<' ';
		}
		cout<<endl;
	}

	return 0;
}

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

int main(){
	bool f=false;
	int n,i,j;
	int a[5];
	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++: #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(){
	
	int d;
	string ge5[] = {"* ="," *="};
	string lt5[] = {" ****","* ***","** **","*** *", "**** "};
	bool isnl=false;
	while(~scanf("%d",&d)){
		if(isnl) cout << endl;
		vector<string> res;

		string str;
		while(d>0){ str += (d % 10) + '0'; d/=10;}
		reverse(str.begin(),str.end());

		//for(int i=0;i<str.size();i++){if(!isdigit(str[i])) str = str.substr(0,i); break;}
		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]);

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

		for(int i=0;i<8;i++){
			for(int j=0;j<5;j++){
				cout << table[i][j];
			}
			cout << endl;
		}
		isnl = true;
	}

	exit(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(str.empty()) continue;
		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 <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <complex>
#include <fstream>
#include <iomanip>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }

int main()
{
	string str;
	while(cin >> str)
	{
		deque<string> res;

		rep(i, 5)
		{
			if(str.size() <= i)
				res.push_front("* = ****");
			else
			{
				if(str[i] - '0' < 5)
					res.push_back("* =");
				else
				{
					str[i] -= 5;
					res.push_back(" *=");
				}

				rep(j, str[i] - '0')
					res[i] += "*";

				res[i] += " ";

				rep(j, 5 - (str[i] - '0' + 1))
					res[i] += "*";
			}
		}

		rep(i, 8) rep(j, 5)
			cout << res[j][i] << (j == 4 ? "\n" : "");
	}
}