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

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <complex>
#include <algorithm>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <cmath>
#include <math.h>
#include <numeric>
#include <list>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <climits>
#include <set>
#include <memory.h>
#include <memory>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cassert>
#include <map>
#include <cassert>
#include <time.h>

using namespace std;

typedef complex<double> xy_t;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int , P> PP;
typedef pair<int, string> Ps;
typedef vector<int> vec;
typedef vector<vec> mat;
const int INF= 1 << 30;
const double EPS = 1e-9;
const double PI = 3.1415926535897932384626433832795;

#define rep(i, n) for(int i = 0; i < n; i++)

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

int main(){
	int n;
	int cnt = 0;
	while(cin >> n){
		if(cnt == 0) cnt++;
		else cout << endl;
		int num = 1;
		string res[5];
		rep(i, 5){
			res[i] = aba[(n % (num * 10)) / num];
			num *= 10;
		}
		rep(i, 7){
			rep(j, 5){
				cout << res[4-j][i];
			}
			cout << endl;
		}
	}
	return 0;
}