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

		while ( line.length() < 5 )
		{
			line = "0" + line;
		}

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

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()

using namespace std;

typedef unsigned int uint;
typedef long long ll;

const char *data[10]={
  "* = *****",
  "* =* ****",
  "* =** ***",
  "* =*** **",
  "* =**** *",
  " *= *****",
  " *=* ****",
  " *=** ***",
  " *=*** **",
  " *=**** *",
};

int main(){
  int n;
  int cc = 0;
  while(cin>>n){
    char buff[8][6] = {{0}};
    if(cc++ != 0) puts("");
    REP(i,5){
      int d = n % 10;
      //printf("d = %d, data[d] = %s\n",d,data[d]);
      REP(j,8){
        buff[j][4-i] = data[d][j];
        //printf("buff = %c\n",buff[j][5-i]);
      }
      n/=10;
    }
    REP(i,8) puts(buff[i]);
  }
}

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("");
		}
	}
	
	return(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 <vector>
#include <algorithm>
#include <string>

using namespace std;

int main(){

	string num;
	while(cin>>num){
		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;
		cout<<endl;
	}

	return 0;
}

C++: #include<iostream>
#include<string>
#include<cmath>
using namespace std;
int a[5], b[5], c, cnt;
int main() {
	while (cin >> c) {
		if (cnt) { cout << endl; }
		cnt++;
		for (int i = 0; i < 5; i++) {
			a[4 - i] = ((c / (int)pow(10, i)) % 10) / 5;
			b[4 - i] = (c / (int)pow(10, i)) % 5;
		}

		for (int i = 0; i < 5; i++) {
			if (a[i] == 0) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;

		for (int i = 0; i < 5; i++) {
			if (a[i] == 1) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;

		for (int i = 0; i < 5; i++) {
			cout << '=';
		}
		cout << endl;

		for (int i = 0; i < 5; i++) {
			if (b[i] != 0) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;

		for (int i = 0; i < 5; i++) {
			if (b[i] != 1) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;

		for (int i = 0; i < 5; i++) {
			if (b[i] != 2) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;

		for (int i = 0; i < 5; i++) {
			if (b[i] != 3) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;

		for (int i = 0; i < 5; i++) {
			if (b[i] != 4) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;
	}
}