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>
using namespace std;
int main() {
	int a;
	while (cin >> a){
		int b[5] = { 0 };
		if (a < 10){
			b[4] = a;
		}
		else if (a < 100){
			b[4] = a % 10;
			a -= b[4];
			a /= 10;
			b[3] = a;
		}
		else if (a < 1000){
			b[4] = a % 10;
			a -= b[4];
			a /= 10;
			b[3] = a % 10;
			a -= b[3];
			a /= 10;
			b[2] = a;
		}
		else if (a < 10000){
			b[4] = a % 10;
			a -= b[4];
			a /= 10;
			b[3] = a % 10;
			a -= b[3];
			a /= 10;
			b[2] = a % 10;
			a -= b[2];
			a /= 10;
			b[1] = a;
		}
		else{
			b[4] = a % 10;
			a -= b[4];
			a /= 10;
			b[3] = a % 10;
			a -= b[3];
			a /= 10;
			b[2] = a % 10;
			a -= b[2];
			a /= 10;
			b[1] = a % 10;
			a -= b[1];
			a /= 10;
			b[0] = a;
		}
		for (int i = 0; i < 5; i++){
			if (b[i] < 5)cout << '*';
			else cout << ' ';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			if (b[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 (b[i] % 5 == 0)cout << ' ';
			else cout << '*';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			if (b[i] % 5 == 1)cout << ' ';
			else cout << '*';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			if (b[i] % 5 == 2)cout << ' ';
			else cout << '*';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			if (b[i] % 5 == 3)cout << ' ';
			else cout << '*';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			if (b[i] % 5 == 4)cout << ' ';
			else cout << '*';
		}
		cout << endl;
	}

}

C++: #include<iostream>
#include<string>
using namespace std;
string s[10]={
	"* = ****",
	"* =* ***",
	"* =** **",
	"* =*** *",
	"* =**** ",
	" *= ****",
	" *=* ***",
	" *=** **",
	" *=*** *",
	" *=**** "
};
int main(){
	string d;
	int c[5];
	bool first=true;
	while(cin>>d){
		if(!first)cout<<endl;
		first=false;
		for(int i=0;i<5;i++)c[i]=0;
		for(int i=0;i<d.size();i++)c[5-d.size()+i]=d[i]-'0';
		for(int i=0;i<8;i++){
			for(int j=0;j<5;j++){
				cout<<s[c[j]][i];
			}
			cout<<endl;
		}
	}
	return 0;
}

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

char number[][16] = {
	"* = ****", "* =* ***", "* =** **", "* =*** *", "* =**** ",
	" *= ****", " *=* ***", " *=** **", "* =*** *", "* =**** ", };

int main() {
	int n;
	bool flag = false;
	while(cin >> n) {
		char board[16][16] = {0};
		/* init */
		for(int i = 0; i < 5; i++) {
			for(int j = 0; j < 8; j++) {
				board[j][4 - i] = number[n % 10][j];
			}
			n /= 10;
		}

		if(flag)
			cout << endl;
		for(int i = 0; i < 8; i++)
			printf("%s\n", board[i]);
		flag = true;
	}

	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(){
	
	string str;
	string ge5[] = {"* ="," *="};
	string lt5[] = {" ****","* ***","** **","*** *", "**** "};
	bool isnl=false;
	while(cin >> str){
		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);
		}

		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" : "");
			}
		}
	}
}

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