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>

int main()
{
	char abacus[8][5];
	
	bool first=true;
	while(1)
	{
		int num;
		std::cin>>num;
		if(std::cin.eof())break;
		
		for(int c=4;c>=0;i--)
		{
			int digit=num%10;
			num/=10;
			int q=digit/5;
			int s=digit%5;
			int i=0;
			if(q==1)
			{
				abacus[0][c]=' ';
				abacus[1][c]='*';
			}
			else
			{
				abacus[0][c]='*';
				abacus[1][c]=' ';
			}
			abacus[2][c]='=';
			
			for(i=3;i<3+s;i++)
			{
				abacus[i][c]='*';
			}
			abacus[i++][c]=' ';
			for(;i<8;i++)
			{
				abacus[i][c]='*';
			}
		}
		if(first){first=false;}
		else{std::cout<<std::endl;}
		for(int i=0;i<8;i++)
		{
			for(int j=0;j<5;j++)
			{
				std::cout<<abacus[i][j];
			}
			std::cout<<std::endl;
		}
	}
	return 0;
}

C++: #include<iostream>

void makeabacus(char abacus[8][5],int num,int c);
void output(char abacus[8][5]);

int main()
{
	char abacus[8][5];
	
	bool first=true;
	while(1)
	{
		int num;
		std::cin>>num;
		if(std::cin.eof())break;
		
		for(int i=4;i>=0;i--)
		{
			int digit=num%10;
			num/=10;
			makeabacus(abacus,digit,i);
		}
		if(first){first=false;}
		else{std::cout<<std::endl;}
		output(abacus);
	}
	return 0;
}

void makeabacus(char abacus[8][5],int num,int c)
{
	int q=num/5;
	int s=num%5;
	int i=0;
	if(q==1)
	{
		abacus[0][c]=' ';
		abacus[1][c]='*';
	}
	else
	{
		abacus[0][c]='*';
		abacus[1][c]=' ';
	}
	abacus[2][c]='=';
	
	for(i=3;i<3+s;i++)
	{
		abacus[i][c]='*';
	}
	abacus[i++][c]=' ';
	for(;i<8;i++)
	{
		abacus[i][c]='*';
	}
}

void output(char abacus[8][5])
{
	for(int i=0;i<8;i++)
	{
		for(int j=0;j<5;j++)
		{
			std::cout<<abacus[i][j];
		}
		std::cout<<std::endl;
	}
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(int x=from;x<to;x++)
typedef long long ll;

using namespace std;


string sb( int n){
	string res = ((n>4)? " *=": "* =");
	if (n%5>3)  res += "**** ";
	else if (n%5>2)  res += "*** *";
	else if (n%5>1)  res += "** **";
	else if (n%5>0)  res += "* ***";
	else  res += " ****";
    return res;
}

int main(void){

int n;
string ss[5], sd[8];
	while(cin >> n){
		if(cin.eof()) break;
		int wk=100000;
		rep(i,5){
			int z = (n%wk )/(wk/10);
			ss[i] = sb(z);
			wk /= 10;
		}
		rep(j,8) sd[j] = "     ";
		rep(i,5) rep(j,8) sd[j][i] = ss[i][j];
		
//		rep(i,5)cout << ss[i] << endl;
		rep(i,8)cout << sd[i] << endl;
	}
	return 0;
	
}

C++: #include<string>
#include<iostream>
using namespace std;
int main() {
	string a;
	int l = 0;
	while (cin >> a) {
		if(l==1)cout << endl;
		l = 1;
		int b[5], c[5],e[5];
		fill(b, b + 5, 0);
		fill(c, c + 5, 0);
		fill(e, e + 5, 4);
		for (int i = a.length() - 1; i >= 0; i--) {
			int d = (int)a[i] - '0';
			if (d >= 5) {
				b[5 - a.length() + i]++;
				d -= 5;
			}
			c[5 - a.length() + i] += d;
			e[5 - a.length() + i] -= d;
		}
		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] != 0)
				cout << "*";
			else
				cout << " ";
		}
		cout << endl;
		for (int i = 0; i < 5; i++)
			cout << "=";
		cout << endl;
		for (int i = 0; i < 5; i++) {
			for (int j = 0; j < 5; j++) {
				if (c[j] != 0) {
					cout << "*";
					c[j]--;
				}
				else if (i >= 5 - e[j]) {
					cout << "*";
				}
				else
					cout << " ";
			}
			cout << endl;
		}
	}
}

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

using namespace std;

void solve()
{
	vector<string> abacus(10);
	abacus[0] = "* = ****";
	abacus[1] = "* =* ***";
	abacus[2] = "* =** **";
	abacus[3] = "* =*** *";
	abacus[4] = "* =**** ";
	abacus[5] = " *= ****";
	abacus[6] = " *=* ***";
	abacus[7] = " *=** **";
	abacus[8] = " *=*** *";
	abacus[9] = " *=**** ";
	bool first = true;
	string input;
	while(cin >> input)
	{
		if(!first)
		{
			cout << endl;
		}
		first = false;
		string str;
		if(input.size() < 5)
		{
			for(int i = 0; i < 5 - input.size(); ++i)
			{
				str += "0";
			}
			str += input;
		}
		vector<string> data(5);
		for(int i = 0; i < str.size(); ++i)
		{
			data[i] = abacus[str[i] - '0'];
		}
		for(int i = 0; i < 8; ++i)
		{
			for(int j = 0; j < 5; ++j)
			{
				cout << data[j][i];
			}
			cout << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}

C++: # define _CRT_SECURE_NO_WARNINGS 1
# include <iostream>
# include <string>
# include <bitset>
# include <vector>
# include <algorithm>
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iomanip>
# include <queue>
# include <sstream>
# include <climits>
# include <cmath>
# include <list>
# include <functional>
# include <string>
# include <ctime>
# include <set>
# include <map>
# include <stack>
# include <unordered_map>
using namespace std;
//# define M_PI 3.141592
# define INF ((int)(1<<30))
# define FOR(i,n) for(int i=0;i<(int)n;i++)
# define FORI(i,k,n) for(int i=k;i<(int)n;i++)
# define toRad 2.0*M_PI/360.0
# define inin(x) int x;cin>>x;
# define all(x) x.begin(),x.end()
# define debug(x) cout<<#x<<" :"<<x<<endl;
# define rep(i,n) for(int i=0;i<(int)n;i++)
# define EPS 1e-12
# define CHECK(i,a) FOR(i,a.size())cout<<#a<<"["<<i<<"] : "<<a[i]<<endl; 

int main()
{
	string s;
	bool f = false;
	while (cin >> s)
	{
		if (f)cout << endl;
		reverse(all(s));
		while (s.size() < 5)s += '0';
		reverse(all(s));
		f = true;
		for (int i = 0; i < s.size(); i++)
		{
			char c = '*';
			if (s[i] >= '5')
				c = ' ';
			cout << c;
		}cout << endl;
		for (int i = 0; i < s.size(); i++)
		{
			char c = ' ';
			if (s[i] >= '5')
				c = '*';
			cout << c;
		}cout << endl;
		for (int i = 0; i < s.size(); i++)
		{
			cout << '=';
		}cout << endl;

		for (int j = 0; j < 5; j++)
		{
			for (int i = 0; i < s.size(); i++)
			{
				char c = '*';
				if (s[i] == '0' + j || s[i] == '5' + j)
					c = ' ';
				cout << c;
			}cout << endl;
		}



	}

}