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

char* abacusFigure[] =
{
	"* = ****",
	"* =* ***",
	"* =** **",
	"* =*** *",
	"* =**** ",
	" *= ****",
	" *=* ***",
	" *=** **",
	" *=*** *",
	" *=**** ",
};

int main()
{
	bool first = true;
	char input[ 6 ];
	while( cin >> input ){
		char figure[ 6 ];
		int len = strlen( input );
		for( int i = 0; i < 5 - len; ++i ){
			figure[ i ] = '0';
		}
		for( int i = 0; i < len; ++i ){
			figure[ 5 - len + i ] = input[ i ];
		}
		figure[ 6 ] = '\0';

		if( first ){
			first = false;
		}else{
			cout << endl;
		}
		for( int i = 0; i < 8; ++i ){
			for( int j = 0; j < 5; ++j ){
				cout << abacusFigure[ figure[ j ] - '0' ][ i ];
			}
			cout << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
main(){
string b[] = {"* = ****","* =* ***","* =** **","* =*** *","* =**** "," *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "},i;
int f=0,k,l;
while(cin>>i,!cin.eof()){
f&&cout<<endl;
f?:f=1;
while(i.size()<5)i='0'+i;
for(k=0;k<8;k++){
for(l=0;l<5;l++)cout<<b[i[l]-'0'][k];
cout<<endl;
}
}
}

C++: #include <iostream>
using namespace std;
int main(){
	string b[] = {"* = ****","* =* ***","* =** **","* =*** *","* =**** "," *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "},i;
	int f = 0, k, l;
	while(cin >> i,!cin.eof()){
		f&&cout<<endl;
		f?:f=1;
		while(i.size() < 5)i = '0' + i;
		for(k=0;k<8;k++){
			for(l=0;l<5;l++)cout << b[i[l]-'0'][k];
			cout << endl;
		}
	}
}

C++: #include <iostream>

using namespace std;

string str[10],in;

void init(){
  str[0] = "* = ****";
  str[1] = "* =* ***";
  str[2] = "* =** **";
  str[3] = "* =*** *";
  str[4] = "* =**** ";
  str[5] = " *= ****";
  str[6] = " *=* ***";
  str[7] = " *=** **";
  str[8] = " *=*** *";
  str[9] = " *=**** ";
}

void solve(string s,int count){
  if(count) cout << endl;

  int len = (int)s.size();
  string ans[5];  

  if(len == 5){
    for(int i = 0 ; i < len ; i++)
      ans[i] = str[s[i]-'0'];
  }
  else{
    for(int i = 0 ; i < 5-len ; i++){
      ans[i] = str[0];
    }
  
    int t = 0;
    for(int i = 5-len ; i < 5 ; i++)
      ans[i] = str[s[t++]-'0'];
  }

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

int main(){
  init();

  int count = 0;
  while(cin >> in){
    solve(in,count);
    count++;
  }

  return 0;
}

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


void abacus(int x) {
  char ans[8][6];
  for(int i=0;i<6;i++) {
    ans[0][i] = ' ';
    ans[1][i] = ' ';
    ans[2][i] = '=';
    for(int j=3;j<8;j++) {
      ans[j][i] = '*';
    }
  }
  int a[5];
  a[0] = x/10000;
  x %= 10000;
  a[1] = x/1000;
  x %= 1000;
  a[2] = x/100;
  x %= 100;
  a[3] = x/10;
  x %= 10;
  a[4] = x;
  for(int i=0;i<5;i++) {
    if(a[i] <= 4) {
      ans[0][i] = '*';
      ans[1][i] = ' ';
    }
    else {
      ans[0][i] = ' ';
      ans[1][i] = '*';
    }
    if(a[i] % 5 == 0)
      ans[3][i] = ' ';
    else if(a[i] % 5 == 1)
      ans[4][i] = ' ';
    else if(a[i] % 5 == 2)
      ans[5][i] = ' ';
    else if(a[i] % 5 == 3)
      ans[6][i] = ' ';
    else if(a[i] % 5 == 4)
      ans[7][i] = ' ';
  }
  for(int i=0;i<8;i++) {
    for(int j=0;j<5;j++) {
      cout << ans[i][j];
    }
    cout << endl;
  }

}

int main() {
  int x;
  bool r=false;
  while(cin >> x) {
    if(r)cout << endl;
    abacus(x);
    r=true;
  }
}

C++: #include <iostream>
#include <cstring>

const char PATTERN[10][9] = {
	"* = ****", "* =* ***", "* =** **", "* =*** *", "* =**** ",
	" *= ****", " *=* ***", " *=** **", " *=*** *", " *=**** "};

int main()
{
	std::string input;
	int loops = 0;
	while (getline(std::cin, input)) {
		int n = input.length();
		char abacus[5][9];
		
		for (int i=0; i<5-n; i++) strcpy(abacus[i], PATTERN[0]);
		for (int i=0; i<n; i++) {
			int d = input[i] - '0';
			strcpy(abacus[i+5-n], PATTERN[d]);
		}
		if (loops>0) std::cout << std::endl;
		
		for (int j=0; j<8; j++) {
			for (int i=0; i<5; i++) {
				std::cout << abacus[i][j];
			}
			std::cout << std::endl;
		}
		
		loops++;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	char ball[10][8] = {{'*',' ','=',' ','*','*','*','*'},
											{'*',' ','=','*',' ','*','*','*'},
											{'*',' ','=','*','*',' ','*','*'},
											{'*',' ','=','*','*','*',' ','*'},
											{'*',' ','=','*','*','*','*',' '},
											{' ','*','=',' ','*','*','*','*'},
											{' ','*','=','*',' ','*','*','*'},
											{' ','*','=','*','*',' ','*','*'},
											{' ','*','=','*','*','*',' ','*'},
											{' ','*','=','*','*','*','*',' '}};
	string i;
	while(cin >> i,!cin.eof()){
	for(int j=0;j<5-i.size();j++)i = '0' + i;
	for(int k=0;k<8;k++){
		for(int l=0;l<5;l++){
			cout << ball[l][k];
		}
		cout << endl;
	}
	cout << endl;
	}
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
using namespace std;

typedef istringstream ISS;
typedef ostringstream OSS;
typedef vector<string> VS;
typedef int INT;
typedef vector<INT> VI;
typedef vector<VI> VVI;
typedef pair <INT, INT> II;
typedef vector <II> VII;

template<class T> ostream& operator << ( ostream& os, vector<T> v ) {
    for ( typename vector<T>::iterator it_i = v.begin(); it_i != v.end(); ++it_i ) {
        os << *it_i << ", ";
    }
    return os;
}


string s;
int n;
int A[6];
int B[6];
char T[8][6];

void solve() {
    for ( int i = 0; i < 8; ++ i ) {
        for ( int j = 0; j < 5; ++ j ) {
            T[i][j] = '*';
        }
        T[i][5] = '\0';
    }
    for ( int i = 0; i < 5; ++ i ) {
        T[2][i] = '=';
    }

    for ( int i = 0; i < n; ++ i ) {
        int k = s[i] - '0';
        if ( k >= 5 ) A[i] = 0;
        else A[i] = 1;
        B[i] = k % 5;
    }

    for ( int i = 0; i < n; ++ i ) {
        T[A[i]][i] = ' ';
        T[3+B[i]][i] = ' ';
    }
}

void output() {
    for ( int i = 0; i < 8; ++ i ) {
        cout << T[i] << endl;
    }
}

string addPrefix( string s ) {
    while ( s.size() < 5 ) {
        s = "0" + s;
    }
    return s;
}

int main() {
    bool flag = true;
    while ( cin >> s ) {
        if ( ! flag ) cout << endl;
        flag = false;
        s = addPrefix(s);
        n = s.size();
        solve();
        output();
    }
    return 0;
}