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>
#include<string>
#include<cstring>
using namespace std;

int main(void){
	string str;
	char aba[9][9];
	while(cin >> str){
		string str2;
		for(int i=str.size();i<5;i++){
			str2+="0";
		}
		str2+=str;
		memset(aba,'\0',sizeof(aba));
		for(int i=0;i<str2.size();i++){
			if(str2[i]<'5')aba[i][0]='*',aba[i][1]=' ';
			else aba[i][0]=' ',aba[i][1]='*';
			aba[i][2]='=';
			for(int j=3;j<8;j++){
				if(j-3==(str2[i]-'0')%5)aba[i][j]=' ';
				else aba[i][j]='*';
			}
		}
		for(int i=0;i<8;i++){
			for(int j=0;j<str2.size();j++){
				printf("%c",aba[j][i]);
			}
			printf("\n");
		}
		printf("\n");
	}
    return 0;
}

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

int main()
{
	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 <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define each(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())
#define range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 30;

string digits[10];

int main(void){
	rep(i,10){
		digits[i]="";
		if(i>=5)
			digits[i]+=" *=";
		else
			digits[i]+="* =";
		rep(j,5){
			if(i%5==j)
				digits[i]+=" ";
			else
				digits[i]+="*";
		}
	}
	string in;
	bool first=true;
	while(cin >> in ){
		if(cin.eof())
			break;
		else if(!first){
			first=false;
			cout << endl;
		}
		while(in.size() < 5)
			in = "0"+in;
		rep(i,8){
			rep(j,5)
				cout << digits[(in[j]-'0')][i];
			cout << endl;
		}
	}
	return 0;
}

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

#define rep(i, n) for(i = 0;i < n;++i)

char f[5][8];
signed main(void){
  int i, j, n;
  for(int t = 0;;t++){
    if(scanf("%d", &n) == -1)break;
    if(t)puts("");
    rep(i, 5){
      rep(j, 8)f[i][j] = '*';
      f[i][2] = '=';
      f[i][1 - (n % 10) / 5] = ' ';
      f[i][3 + (n % 5)] = ' ';
      n /= 10;
    }

    rep(j, 8){
      rep(i, 5)printf("%c", f[4 - i][j]);
      puts("");
    }
  }
  return 0;
}

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

int main() {
    while (true){
        int N;
        int num[5] = {0};
        
        cin >> N;
        
        if(N == EOF) break;
        
        num[0] = N/10000;
        N %= 10000;
        num[1] = N/1000;
        N %= 1000;
        num[2] = N/100;
        N %= 100;
        num[3] = N/10;
        N %= 10;
        num[4] = N;
        
        for(int i = 0; i < 5; i++) {
            if(num[i] < 5) cout << '*';
            else cout << " ";
        }
        
        cout << endl;
        
        for(int i = 0; i < 5; i++) {
            if(num[i] > 4) cout << '*';
            else cout << " ";
        }
        
        cout << endl;
        
        for(int i = 0; i < 5; i++) {
            cout << "=";
        }
        cout << endl;
        
        for(int i = 0; i > 5; i++) {
            if(num[i] > 4) num[i] -= 5;
        }
        
        for(int i = 0; i < 5; i++) {
            if(num[i] != 0) cout << '*';
            else cout << " ";
        }
        
        cout << endl;
        
        for(int i = 0; i < 5; i++) {
            if(num[i] != 1) cout << '*';
            else cout << " ";
        }
        
        cout << endl;
        
        for(int i = 0; i < 5; i++) {
            if(num[i] != 2) cout << '*';
            else cout << " ";
        }
        
        cout << endl;
        
        for(int i = 0; i < 5; i++) {
            if(num[i] != 3) cout << '*';
            else cout << " ";
        }
        
        cout << endl;
        
        for(int i = 0; i < 5; i++) {
            if(num[i] != 4) cout << '*';
            else cout << " ";
        }
        
        cout << "\n\n";
    }
    return 0;
}

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

int main(){
    int n,i,j;
    while( cin >> n ){
        int f[5], s[5];
        for(i=4;i>=0;i--){
            f[i] = n%10/5;
            s[i] = n%5;
            n /= 10;
        }
        for(i=0;i<5;i++){
            if(!f[i]) cout << "*";
            else cout << " ";
        }
        cout << endl;
        for(i=0;i<5;i++){
            if(f[i]) cout << "*";
            else cout << " ";
        }
        cout << endl;
        cout << "=====" << endl;
        for(i=0;i<5;i++){
            for(j=0;j<5;j++){
                if(s[j]==i) cout << " ";
                else cout << "*";
            }
            cout << endl;
        }
    }
    return 0;
}