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 <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)

int main() {
	string str[10] = {"* = ****", "* =* ***", "* =** **", "* =*** *", "* =**** ",
					 " *= ****", " *=* ***", " *=** **", " *=*** *", " *=**** "
	};
	bool flag = false;
	int x;

	while (cin >> x) {
		if (flag) puts("");
		
		int ans[5];
		for (int i = 4; i >= 0; i--) {
			ans[i] = x % 10;
			x /= 10;
		}
		
		REP(i, 8) {
			REP(j, 5) {
			printf("%c", str[ans[j]][i]);
			}
			puts("");
		}
		
		flag = true;
	}
	return 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" : "");
		cout << endl;
	}
}

C++: #include<stdio.h>
#include<string>
#include<iostream>
using namespace std;

int main(){
string str;

char ch[10][6];
char n1[10]="* =* ***";
char n2[10]="* =** **";
char n3[10]="* =*** *";
char n4[10]="* =**** ";
char n5[10]=" *= ****";
char n6[10]=" *=* ***";
char n7[10]=" *=** **";
char n8[10]=" *=*** *";
char n9[10]=" *=**** ";
char n0[10]="* = ****";
char nn[10];
bool first=true;
while(cin>>str){

	if(first==false)cout<<endl;
	first=false;
int t=5-str.size();
bool f=true;

for(int i=0;i<5;i++){
	if(i<t){		
	for(int j=0;j<8;j++)
	nn[j]=n0[j];
	f=false;
}
	else{

char y=str[i-t];


if(y=='0'){
	for(int j=0;j<8;j++)
	nn[j]=n0[j];
}
else if(y=='1'){
	for(int j=0;j<8;j++)nn[j]=n1[j];
}
else if(y=='2'){
	for(int j=0;j<8;j++)nn[j]=n2[j];
}
else if(y=='3'){
	for(int j=0;j<8;j++)nn[j]=n3[j];
}
else if(y=='4'){
	for(int j=0;j<8;j++)nn[j]=n4[j];
}
else if(y=='5'){
	for(int j=0;j<8;j++)nn[j]=n5[j];
}
else if(y=='6'){
	for(int j=0;j<8;j++)nn[j]=n6[j];
}
else if(y=='7'){
	for(int j=0;j<8;j++)nn[j]=n7[j];
}
else if(y=='8'){
	for(int j=0;j<8;j++)nn[j]=n8[j];
}
else if(y=='9'){
	for(int j=0;j<8;j++)nn[j]=n9[j];
}
	if(y!='9'&&y!='4')f=false;
	}
	
for(int j=0;j<8;j++){

ch[j][i]=nn[j];

}
	
}
int w=8;
	if(f==true)w=7;
for(int i=0;i<w;i++){
for(int j=0;j<5;j++)
cout<<ch[i][j];

cout<<endl;
}

}
return 0;
}

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

using namespace std;

int main(){
  int i, j, n, m, data[5];
  string abacus[10];

  abacus[0] = "* = ****";
  abacus[1] = "* =* ***";
  abacus[2] = "* =** **";
  abacus[3] = "* =*** *";
  abacus[4] = "* =**** ";
  abacus[5] = " *= ****";
  abacus[6] = " *=* ***";
  abacus[7] = " *=** **";
  abacus[8] = " *=*** *";
  abacus[9] = " *=**** ";

  while(cin >> n){
    for(i=0, j=10000; i<5; ++i, j/=10){
      m = n/j;
      n = n - m*j;
      data[i] = m;
    }

    for(i=0; i<8; ++i){
      for(j=0; j<5; ++j){
	cout << abacus[data[j]][i];
      }
      cout << endl;
    }
  }
  return 0;
}

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

int main(){

	int n;
	std::vector<int>v;
	while (std::cin >> n)v.push_back(n);

	for (int k = 0; k < v.size(); k++){
		char soro[8][5];
		for (int i = 0; i < 8; i++){
			for (int j = 0; j < 5; j++){
				soro[i][j] = '*';
			}
		}
		for (int i = 0; i < 5; i++)soro[2][i] = '=';

		for (int i = 4; i >= 0; i--){
			int mod = v[k] % 10;

			if (mod == 0 || mod == 5)soro[3][i] = ' ';
			if (mod == 1 || mod == 6)soro[4][i] = ' ';
			if (mod == 2 || mod == 7)soro[5][i] = ' ';
			if (mod == 3 || mod == 8)soro[6][i] = ' ';
			if (mod == 4 || mod == 9)soro[7][i] = ' ';

			if (mod < 5)soro[1][i] = ' ';
			else soro[0][i] = ' ';

			v[k] /= 10;
		}

		for (int i = 0; i < 8; i++){
			for (int j = 0; j < 5; j++){
				std::cout << soro[i][j];
			}
			std::cout << std::endl;
		}
		if (k != v.size() - 1)std::cout << std::endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<string>
using namespace std;int main(){int i,j=0,n[5];string s,l[2]={" ","*"};char x[6];while(cin>>i){if(j)cout<<endl;sprintf(x,"%05d",i);for(j=5;j-->0;)n[j]=x[j]-'0';s="";while(j++<1){for(i=0;i<5;i++)s+=l[j+(n[i]<5)&1];s+="\n";}for(j=5;j-->0;)s+="=";s+="\n";while(j++<4){for(i=0;i<5;i++)s+=l[n[i]%5!=j];s+="\n";}cout<<s;}return 0;}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
int main()
{
	char s[6], r[5][8], d;
	int n, i, j, c, b = 0;
	while (1)
	{
		if (cin.eof()) break;
		cin >> n;
		if (b>0) cout << endl;
		sprintf(s, "%05d", n);
		for (i = 0; i < 5; i++)
		{
			d = (char)s[i];
			c = atoi(&d);
			if (c < 5)
			{
				r[i][0] = '*';
				r[i][1] = ' ';
			}
			else
			{
				r[i][0] = ' ';
				r[i][1] = '*';
			}
			r[i][2] = '=';
			for (j = 3; j < 8; j++)
			{
				if (c != j-3 && c != j+2)
					r[i][j] = '*';
				else
					r[i][j] = ' ';
			}
		}
		for (i = 0; i < 8; i++)
		{
			for (j = 0; j < 5; j++)
			{
				cout << r[j][i];
			}
			cout << endl;
		}
		b++;
	}
}

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

const std::string s[8] = { "*****     ",
						   "     *****",
						   "==========",
						   " **** ****",
						   "* **** ***",
						   "** **** **",
						   "*** **** *",
						   "**** **** " };

int main()
{
	int n;
	bool fst = true;
	
	while( std::cin >> n )
	{
		if( !fst )
			std::cout << std::endl;
		
		fst = false;

		std::vector<int> digit;
		for( int i = 0; i != 5; ++i )
		{
			digit.push_back( n % 10 );
			n /= 10;
		}

		for( int i = 0; i != 8; ++i )
		{
			for( int j = digit.size() - 1; j >= 0; --j )
				std::cout << s[i][digit[j]];

			std::cout << std::endl;
		}
	}

	return 0;
}