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

int main(void)
{
	char abacus[8][10] = {
		"*****     ",
		"     *****",
		"==========",
		" **** ****",
		"* **** ***",
		"** **** **",
		"*** **** *",
		"**** **** ",
	};
	
	int n;
	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]];
			}
		}
		for (int i = 0; i < 8; i++){
			for (int j = 0; j < 5; j++){
				cout << a[i][j];
			}
			cout << endl;
		}
		cout << endl;
	}
	
	return (0);
}

C++: #include<algorithm>
#include<iostream>
#include<string>
using namespace std;
int main(){
  int h=0,i;
  int len;
  for(;;){
    string s;
    cin>>s;
    if(s.empty())
      break;
    len=s.length();
    if(h)
      cout<<endl;
    h=1;
    for(i=0;i<5-len;i++)
      cout<<"*";
    for(i=0;i<len;i++){
      if((s[i]-'0')/5)
	cout<<" ";
      else
	cout<<"*";
    }
    cout<<endl;
    for(i=0;i<5-len;i++)
      cout<<" ";
    for(i=0;i<len;i++){
      if((s[i]-'0')/5)
	cout<<"*";
      else
	cout<<" ";
    }
    cout<<endl<<"====="<<endl;
    for(i=0;i<5-len;i++)
      cout<<" ";
    for(i=0;i<len;i++){
      if((s[i]-'0')%5==0)
	cout<<" ";
      else
	cout<<"*";
    }
    cout<<endl;
    for(i=0;i<5-len;i++)
      cout<<"*";
    for(i=0;i<len;i++){
      if((s[i]-'0')%5==1)
	cout<<" ";
      else
	cout<<"*";
    }
    cout<<endl;
    for(i=0;i<5-len;i++)
      cout<<"*";
    for(i=0;i<len;i++){
      if((s[i]-'0')%5==2)
	cout<<" ";
      else
	cout<<"*";
    }
    cout<<endl;
    for(i=0;i<5-len;i++)
      cout<<"*";
    for(i=0;i<len;i++){
      if((s[i]-'0')%5==3)
	cout<<" ";
      else
	cout<<"*";
    }
    cout<<endl;
    for(i=0;i<5-len;i++)
      cout<<"*";
    for(i=0;i<len;i++){
      if((s[i]-'0')%5==4)
	cout<<" ";
      else
	cout<<"*";
    }
    cout<<endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define repb(i,a,b) for(int i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define int long long
#define fi first
#define se second
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

string t[10]={
	"* = ****",
	"* =* ***",
	"* =** **",
	"* =*** *",
	"* =**** ",
	" *= ****",
	" *=* ***",
	" *=** **",
	" *=*** *",
	" *=**** "
};

signed main(){
	string s;
	bool f=false;
	while(cin>>s){
		if(f) cout<<endl;
		else f=true;
		string ans[6];
		while(s.size()<5) s='0'+s;
		rep(i,0,s.size()) ans[i]=t[s[i]-'0'];
		rep(i,0,8){
			rep(j,0,5){
				cout<<ans[j][i];
			}
			cout<<endl;
		}
	}
}

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

string abacus(int x){
  string res;
  if(x<5)res += "* =";
  else res += " *=";

  if(x%5 == 0)res += " ****";
  if(x%5 == 1)res += "* ***";
  if(x%5 == 2)res += "** **";
  if(x%5 == 3)res += "*** *";
  if(x%5 == 4)res += "**** ";
  return res;
}
int main(){
  int x;
  bool f = false;

  while(cin>>x){
    if(f)cout << endl;
    f = true;
    string ans[5];
    for(int i=4;i>=0;i--){
      ans[i] = abacus(x%10);
      x /= 10;
    }
 
    for(int i=0;i<8;i++){
      for(int j=0;j<5;j++)cout << ans[j][i];
      cout << endl;
    }
  }
}

C++: #include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>

using namespace std;

int main(){

	int n,S,col;
	char table[8][6];
	bool First = true;

	while(scanf("%d",&n)!=EOF){

		if(!First)printf("\n");

		S = 10;
		for(int i=0; i < 8; i++)table[i][5] = '\0';
		col=4;

		for(int i = 0; i < 5; i++){
			switch(n%S){

			case 0:
				table[0][col] = '*';
				table[1][col] = ' ';
				table[2][col] = '=';
				table[3][col] = ' ';
				table[4][col] = '*';
				table[5][col] = '*';
				table[6][col] = '*';
				table[7][col] = '*';
				break;
			case 1:
				table[0][col] = '*';
				table[1][col] = ' ';
				table[2][col] = '=';
				table[3][col] = '*';
				table[4][col] = ' ';
				table[5][col] = '*';
				table[6][col] = '*';
				table[7][col] = '*';
				break;
			case 2:
				table[0][col] = '*';
				table[1][col] = ' ';
				table[2][col] = '=';
				table[3][col] = '*';
				table[4][col] = '*';
				table[5][col] = ' ';
				table[6][col] = '*';
				table[7][col] = '*';
				break;
			case 3:
				table[0][col] = '*';
				table[1][col] = ' ';
				table[2][col] = '=';
				table[3][col] = '*';
				table[4][col] = '*';
				table[5][col] = '*';
				table[6][col] = ' ';
				table[7][col] = '*';
				break;
			case 4:
				table[0][col] = '*';
				table[1][col] = ' ';
				table[2][col] = '=';
				table[3][col] = '*';
				table[4][col] = '*';
				table[5][col] = '*';
				table[6][col] = '*';
				table[7][col] = ' ';
				break;
			case 5:
				table[0][col] = ' ';
				table[1][col] = '*';
				table[2][col] = '=';
				table[3][col] = ' ';
				table[4][col] = '*';
				table[5][col] = '*';
				table[6][col] = '*';
				table[7][col] = '*';
				break;
			case 6:
				table[0][col] = ' ';
				table[1][col] = '*';
				table[2][col] = '=';
				table[3][col] = '*';
				table[4][col] = ' ';
				table[5][col] = '*';
				table[6][col] = '*';
				table[7][col] = '*';
				break;
			case 7:
				table[0][col] = ' ';
				table[1][col] = '*';
				table[2][col] = '=';
				table[3][col] = '*';
				table[4][col] = '*';
				table[5][col] = ' ';
				table[6][col] = '*';
				table[7][col] = '*';
				break;
			case 8:
				table[0][col] = ' ';
				table[1][col] = '*';
				table[2][col] = '=';
				table[3][col] = '*';
				table[4][col] = '*';
				table[5][col] = '*';
				table[6][col] = ' ';
				table[7][col] = '*';
				break;
			case 9:
				table[0][col] = ' ';
				table[1][col] = '*';
				table[2][col] = '=';
				table[3][col] = '*';
				table[4][col] = '*';
				table[5][col] = '*';
				table[6][col] = '*';
				table[7][col] = ' ';
				break;
			}
			n /= 10;
			col--;
		}

		for(int i=0; i < 8; i++){
			printf("%s\n",table[i]);
		}

		if(First)First = false;
	}

    return 0;
}