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 <iostream>
#include <algorithm>
#include <functional>
using namespace std;

int main() {
    for(int k = 0; k < 2; k++) {
        int N;
        int num[5] = {0};
        
        cin >> N;
        
        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 <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

const string abcus[10] = {"* = ****","* =* ***","* =** **","* =*** *","* =**** "," *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  while(cin >> s){
    while(s.size()<5){
      s = "0" + s;
    }
    rep(i,8){
      rep(j,5){
        cout << abcus[s[j]-'0'][i] ;
      }
      cout << endl;
    }
  }
  return 0;
}

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

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[i[l]-'0'][k];
			}
			cout << endl;
		}
		cout << endl;
	}
}

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 (cin >> n)
	{
		if (cin.eof()) break;
		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>
#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++;
	}
}

C++: #include<stdio.h>

int main(void){
	int n,i,j,k=0;
	int joudan[5],gedan[5];
	int data[7][5];

	while(1){
		
		if(scanf("%d",&n)==EOF)break;
		for(i=0;i<7;i++)
			for(j=0;j<5;j++)
				data[i][j]=1;

		for(i=4;i>=0;i--){
			joudan[i]=(n%10)/5;
			gedan[i]=(n%10)%5;
			n/=10;
		}
		  for(i=0;i<5;i++){//上段の判定
			  if(joudan[i]==1)
				  data[0][i]=0;
			  else 
				  data[1][i]=0;
		  }

		 for(i=0;i<5;i++){//下段の判定
			  if(gedan[i]==0)
				 data[2][i]=0;
			  else if(gedan[i]==1)
				  data[3][i]=0;
			  else if(gedan[i]==2)
				  data[4][i]=0;
			  else if(gedan[i]==3)
				  data[5][i]=0;
			  else if(gedan[i]==4)
				  data[6][i]=0;
		  }
		for(i=0;i<2;i++)
			for(j=0;j<5;j++){
				if(data[i][j]==1)
					printf("*");
				else
					printf(" ");
				if(j==4) printf("\n");
			}

		for(i=0;i<5;i++){
			printf("=");
			if(i==4) printf("\n");
		}

		for(i=2;i<7;i++)
			for(j=0;j<5;j++){
				if(data[i][j]==1)
					printf("*");
				else
					printf(" ");
				if(j==4&&i!=6) printf("\n");
			}
			printf("     \n");
	}
	return 0;
}