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

int main()
{
	char s[5];
	string list[10];
	
	list[0] = "* = ****";
	list[1] = "* =* ***";
	list[2] = "* =** **";
	list[3] = "* =*** *";
	list[4] = "* =**** ";
	list[5] = " *= ****";
	list[6] = " *=* ***";
	list[7] = " *=** **";
	list[8] = " *=*** *";
	list[9] = " *=**** ";
	
	while(scanf("%s", s) != EOF){
		string str = s;
		int len = str.size();
		string num;
		for(int i = 0; i < 5 - len; i++){
			num += "0";
		}
		num += str;
		
		for(int i = 0; i < 8; i++){
			for(int j = 0; j < 5; j++){
				cout << list[num[j] - '0'][i];
			}
			puts("");
		}
	}
	
	return(0);
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,s,b) for(int i=(s);i<(b);i++)
#define rrep(i,s,b) for(int i=(b)-1;i>=(s);i--)
#define all(s) (s).begin(),(s).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

signed main() {
	for (int n, cnt = 0; cin >> n; cnt++) {
		if (cnt)cout << endl;
		string s[5] = {};
		rep(i, 0, 5) {
			int a = n % 10;
			if (a > 5)s[i] += " *=";
			else s[i] += "* =";
			a %= 5;
			rep(j, 0, 5) {
				if (j == a) s[i] += " ";
				s[i] += "*";
			}
			n /= 10;
		}
		rep(h, 0, s[0].size()) {
			string ans = "";
			bool flag = true;
			rep(i, 0, 5) {
				if (flag&&s[i][h] == ' ')continue;
				flag = false;
				ans = s[i][h] + ans;
			}
			cout << ans << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int main(){

	string num;
	while(cin>>num){
		if(num.size()<5){
			while(num.size()<5){
				num='0'+num;
			}
		}
		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]>='5'){
				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]!='0'&&num[i]!='5'){
				cout<<'*';
			}
			else
				cout<<' ';
		}
		cout<<endl;
		for(int i = 0; i < 5; i++){
			if(num[i]!='1'&&num[i]!='6')
				cout<<'*';
			else
				cout<<' ';
		}
		cout<<endl;
		for(int i = 0; i < 5; i++){
			if(num[i]!='2'&&num[i]!='7')
				cout<<'*';
			else
				cout<<' ';
		}
		cout<<endl;
		for(int i = 0; i < 5; i++){
			if(num[i]!='3'&&num[i]!='8')
				cout<<'*';
			else
				cout<<' ';
		}
		cout<<endl;
		for(int i = 0; i < 5; i++){
			if(num[i]!='4'&&num[i]!='9')
				cout<<'*';
			else
				cout<<' ';
		}
		cout<<endl;
		cout<<endl;
	}

	return 0;
}

C++: #include<iostream>
#include<string>
#include<cmath>
using namespace std;
int a[5], b[5], c, cnt;
int main() {
	while (cin >> c) {
		if (cnt) { cout << endl; }
		cnt++;
		for (int i = 0; i < 5; i++) {
			a[4 - i] = ((c / (int)pow(10, i)) % 10) / 5;
			b[4 - i] = (c / (int)pow(10, i)) % 5;
		}

		for (int i = 0; i < 5; i++) {
			if (a[i] == 0) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;

		for (int i = 0; i < 5; i++) {
			if (a[i] == 1) {
				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] != 0) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;

		for (int i = 0; i < 5; i++) {
			if (b[i] != 1) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;

		for (int i = 0; i < 5; i++) {
			if (b[i] != 2) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;

		for (int i = 0; i < 5; i++) {
			if (b[i] != 3) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;

		for (int i = 0; i < 5; i++) {
			if (b[i] != 4) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;
	}
}

C++: #include <iostream>
using namespace std;
int main(){
	char ball[10][8] = {{'*',' ','=',' ','*','*','*','*'},
											{'*',' ','=','*',' ','*','*','*'},
											{'*',' ','=','*','*',' ','*','*'},
											{'*',' ','=','*','*','*',' ','*'},
											{'*',' ','=','*','*','*','*',' '},
											{' ','*','=',' ','*','*','*','*'},
											{' ','*','=','*',' ','*','*','*'},
											{' ','*','=','*','*',' ','*','*'},
											{' ','*','=','*','*','*',' ','*'},
											{' ','*','=','*','*','*','*',' '}};
	string i;
	cin >> i;
	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;
	}
}

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

using namespace std;

const string abacus[] = {"* = ****",
                         "* =* ***",
                         "* =** **",
                         "* =*** *",
                         "* =**** ",
                         " *= ****",
                         " *=* ***",
                         " *=** **",
                         " *=*** *",
                         " *=**** "};
const int height = 8;

int main()
{
    string s;
    bool flag = false;
    int index;

    while (cin >> s) {
        if (flag)
            putchar('\n');

        while (s.size() < 5)
            s = '0' + s;

        for (int i = 0; i < height; i++) {
            for (int j = 0; j < s.size(); j++) {
                index = (int)(s[j] - '0');
                putchar(abacus[index][i]);
            }
            putchar('\n');
        }
        flag = true;
    }

    return 0;
}

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

int main(){
  string s;
  bool flag=false;
  while(cin>> s){
    int ban[8][5]={0}; //0が空白,1がアスタリスク,2が=
    for(int i=0;i<8;i++){
      if(i==0 || i==4 || i==5 || i==6 || i==7){
	for(int j=0;j<5;j++){
	  ban[i][j]=1;
	}
      }
      else if(i==2){
	for(int j=0;j<5;j++){
	  ban[i][j]=2;
	}
      }
    }

    for(int i=0;i<s.size();i++){
      int x=i+(5-s.size());
      if(s[i]=='1'){
	ban[3][x]=1; ban[4][x]=0;
      }
      else if(s[i]=='2'){
	ban[3][x]=1; ban[5][x]=0;
      }
      else if(s[i]=='3'){
	ban[3][x]=1; ban[6][x]=0;
      }
      else if(s[i]=='4'){
	ban[3][x]=1; ban[7][x]=0;
      }
      else if(s[i]=='5'){
	ban[1][x]=1; ban[0][x]=0;
      }
      else if(s[i]=='6'){
	ban[1][x]=1; ban[0][x]=0;
	ban[3][x]=1; ban[4][x]=0;
      }
      else if(s[i]=='7'){
	ban[1][x]=1; ban[0][x]=0;
	ban[3][x]=1; ban[5][x]=0;
      }
      else if(s[i]=='8'){
	ban[1][x]=1; ban[0][x]=0;
	ban[3][x]=1; ban[6][x]=0;
      }
      else if(s[i]=='9'){
	ban[1][x]=1; ban[0][x]=0;
	ban[3][x]=1; ban[7][x]=0;
      }
    }
    if(flag)
      cout<< endl;
    for(int i=0;i<8;i++){
      for(int j=0;j<5;j++){
	//cout<< ban[i][j];
	if(ban[i][j]==0) cout<< " ";
	else if(ban[i][j]==1) cout<< '*';
	else if(ban[i][j]==2) cout<< '=';
      }
      cout<< endl;
    }
    flag=true;
  }
}