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<iostream>
using namespace std;

int main(void){
	int n;
	while(cin>>n){
		int in[5];
		in[0] = n / 10000	% 10;
		in[1] = n / 1000	% 10;
		in[2] = n / 100		% 10;
		in[3] = n / 10	 	% 10;
		in[4] = n / 1 		% 10;
//		for(int i = 0 ;  i < 5 ; i ++)cout<<int(in[i])<<" ";
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]<5)cout<<"*";
			else cout<<" ";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]>=5){cout<<"*";in[i]-=5;}
			else cout<<" ";
		cout<<endl;
		
		for(int i = 0 ; i < 5 ; i ++)
			cout<<"=";
		cout<<endl;
		
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==0)cout<<" ";
			else cout<<"*";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==1)cout<<" ";
			else cout<<"*";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==2)cout<<" ";
			else cout<<"*";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==3)cout<<" ";
			else cout<<"*";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==4)cout<<" ";
			else cout<<"*";
		cout<<endl;
	}
}

C++: #include<iostream>
using namespace std;
string s[]={
	"* = ****",
	"* =* ***",
	"* =** **",
	"* =*** *",
	"* =**** ",
	" *= ****",
	" *=* ***",
	" *=** **",
	" *=*** *",
	" *=**** ",
};
main()
{
    int cnt=0;
	string t;
	while(cin>>t)
	{
	    if(cnt++>0)cout<<endl;
	    while(t.size()<5)t="0"+t;
		for(int i=0;i<8;i++)
		{
			for(int j=0;j<t.size();j++)
			{
				cout<<s[t[j]-'0'][i];
			}
			cout<<endl;
		}
	}
}

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

int main(void)
{
	char abacus[8][10] = {
		"*****     ",
		"     *****",
		"==========",
		" **** ****",
		"* **** ***",
		"** **** **",
		"*** **** *",
		"**** **** ",
	};
	
	int n;
	bool flag = false;
	while (scanf("%d", &n) != EOF){
		int num[5];
		char a[8][5];
		for (int i = 0; i < 5; i++){
			num[4 - i] = n % 10;
			n /= 10;
		}
		for (int i = 0; i < 8; i++){
			for (int j = 0; j < 5; j++){
				a[i][j] = abacus[i][num[j]];
			}
		}
		
		if (flag){
			cout << endl;
		}
		
		for (int i = 0; i < 8; i++){
			for (int j = 0; j < 5; j++){
				cout << a[i][j];
			}
			cout << endl;
		}
		flag = true;
	}
	
	return (0);
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int main() {
	int n;
	bool first=true;
	while(cin>>n){
		if(!first)cout<<endl;
		first=false;
		int i,j;
		for(i=0,j=10000;i<5;i++,j/=10){
			if(n/j%10<5)cout<<"*";
			else cout<<" ";
		}
		cout<<endl;
		for(i=0,j=10000;i<5;i++,j/=10){
			if(n/j%10<5)cout<<" ";
			else cout<<"*";
		}
		cout<<endl;
		for(i=0;i<5;i++){
			cout<<"=";
		}
		cout<<endl;
		for(i=0,j=10000;i<5;i++,j/=10){
			if(n/j%5==0)cout<<" ";
			else cout<<"*";
		}
		cout<<endl;
		for(i=0,j=10000;i<5;i++,j/=10){
			if(n/j%5==1)cout<<" ";
			else cout<<"*";
		}
		cout<<endl;
		for(i=0,j=10000;i<5;i++,j/=10){
			if(n/j%5==2)cout<<" ";
			else cout<<"*";
		}
		cout<<endl;
		for(i=0,j=10000;i<5;i++,j/=10){
			if(n/j%5==3)cout<<" ";
			else cout<<"*";
		}
		cout<<endl;
		for(i=0,j=10000;i<5;i++,j/=10){
			if(n/j%5==4)cout<<" ";
			else cout<<"*";
		}
		cout<<endl;
	}
	return 0;
}

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