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

while(cin>>str){
int t=5-str.size();

for(int i=0;i<5;i++){
	if(i<t){		
	for(int j=0;j<8;j++)
	nn[j]=n0[j];
}
	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];
}}

for(int j=0;j<8;j++){

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

}
	
}

for(int i=0;i<8;i++){
for(int j=0;j<5;j++)
cout<<ch[i][j];

cout<<endl;
}
cout<<endl;
}
return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

string Input;
bool judgeResult[8][5];

void solve() {
	int j, k, len;
	string tmp;

	len = Input.size();
	tmp = "";
	for (int i = 0; i < 5 - len; i++) {
		tmp += "0";
	}
	Input = tmp + Input;
	len = Input.size();
	//cout << Input << endl;

	for (int i = len - 1; i > -1; i--) {
		//cout << Input[i] << endl;
		if (Input[i] > '4') {
			judgeResult[1][i] = true;
			k = Input[i] - '0' - 5;
		}
		else {
			judgeResult[0][i] = true;
			k = Input[i] - '0';
		}

		for (j = 0; j < k; j++) {
			judgeResult[3+j][i] = true;	
		}
		for (int t = 4 + j; t < 8; t++) {
			judgeResult[t][i] = true;
		}
	}
}


int main() {
	bool flag = false;

	while (cin >> Input) {
		if (flag) {
			cout << endl;
		}
		flag = true;
		memset(judgeResult, false, sizeof(judgeResult));
		solve();
		for (int i = 0; i < 8; i++) {
			if (i == 2) {
				cout << "=====" << endl;
				continue;
			}
			for (int j = 0; j < 5; j++) {
				cout << (judgeResult[i][j] ? "*" : " ");
			}
			cout << endl;
		}
	}

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

signed main(){
int a;
int b=0;
while(cin>>a){
	int k=0;
   bool s[5][7]{};
   if(b)cout<<endl;
   for(int c=10000;c!=0;c/=10,k++){
   	int d=a/c;
   	if(d>4)s[k][1]=true;
   	else s[k][0]=true;
   	for(int h=0;h<5;h++){
   		if(d%5!=h)s[k][h+2]=true;
   	}
   	a-=d*c;
   }
   for(int x=0;x<2;x++){
   	for(int y=0;y<5;y++){if(s[y][x])printf("*");else printf(" ");}
   	printf("\n");
   }
   puts("=====");
   for(int x=3;x<7;x++){
   	for(int y=0;y<5;y++){if(s[y][x])printf("*");else printf(" ");}
   	printf("\n");
   }
   b++;
}
}

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) 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 = 1;
	}
}

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