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 "bits/stdc++.h"
using namespace std;

vector<vector<int>>memo{
	{ 1,0,1,0,1,1,1,1 },
	{ 1,0,1,1,0,1,1,1 },
	{ 1,0,1,1,1,0,1,1 },
	{ 1,0,1,1,1,1,0,1 },
	{ 1,0,1,1,1,1,1,0 },
	{ 0,1,1,0,1,1,1,1 },
	{ 0,1,1,1,0,1,1,1 },
	{ 0,1,1,1,1,0,1,1 },
	{ 0,1,1,1,1,1,0,1 },
	{ 0,1,1,1,1,1,1,0 },
};
int main() {
	string N;
	bool flag = false;
	while (cin >> N) {
		if (flag)cout << endl;
		flag = true;
		int num = 5 - N.size();
		for (int i = 0; i < num; ++i) {

			N.insert(N.begin(), '0');
		}
		vector<string>field(8, "     ");
		for (int i = 0; i < 5; ++i) {
			for (int j = 0; j < 8; ++j) {
				field[j][i] = j == 2 ? '=' : memo[N[i] - '0'][j] ? '*' : ' ';
			}
		}
		for (int i = 0; i < field.size(); ++i) {
			cout << field[i] << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	char ball[10][8] = {{'*',' ','=',' ','*','*','*','*'},
											{'*',' ','=','*',' ','*','*','*'},
											{'*',' ','=','*','*',' ','*','*'},
											{'*',' ','=','*','*','*',' ','*'},
											{'*',' ','=','*','*','*','*',' '},
											{' ','*','=',' ','*','*','*','*'},
											{' ','*','=','*',' ','*','*','*'},
											{' ','*','=','*','*',' ','*','*'},
											{' ','*','=','*','*','*',' ','*'},
											{' ','*','=','*','*','*','*',' '}};
	string i;
	int b = 0;
	while(cin >> i,!cin.eof()){
		if(b)cout<<endl;
		else{b=1;}
		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;
		}
	}
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>

typedef long long ll;

using namespace std;

int main()
{
	int n;
	scanf("%d", &n);
	while (true)
	{
		int d[5];
		for (int i = 0 ; i < 5; ++i, n /= 10)
			d[4-i] = n % 10;

		char soro[7][5 + 1];
		memset(soro, '*', sizeof(soro));
		for (int i = 0; i < 7; ++i)
			soro[i][5] = '\0';

		for (int i = 0; i < 5; ++i)
			soro[d[i] >= 5 ? 0 : 1][i] = ' ';
		for (int i = 0; i < 5; ++i)
			soro[d[i]%5 + 2][i] = ' ';

		for (int i = 0; i < 7; ++i)
		{
			puts(soro[i]);
			if (i == 1)
				puts("=====");
		}
		if (scanf("%d", &n) != EOF)
			putchar('\n');
		else
			break;
	}

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
main(){
  int i=0,c=0;
  string s;
  while(cin>>s){
    if(c++)cout<<endl;
    string t[8];
    r(ii,5){
      r(j,8){
        if(j==2)t[j]+='=';
        else t[j]+='*';
      }
    }
    for(i=0;i<5-s.size();i++)
      t[1][i]=t[3][i]=' ';
    for(;i<5;i++){
      int p=s[i-(5-s.size())]-'0';
      if(p==0)t[1][i]=t[3][i]=' ';
      if(p==1)t[1][i]=t[4][i]=' ';
      if(p==2)t[1][i]=t[5][i]=' ';
      if(p==3)t[1][i]=t[6][i]=' ';
      if(p==4)t[1][i]=t[7][i]=' ';
      if(p==5)t[0][i]=t[3][i]=' ';
      if(p==6)t[0][i]=t[4][i]=' ';
      if(p==7)t[0][i]=t[5][i]=' ';
      if(p==8)t[0][i]=t[6][i]=' ';
      if(p==9)t[0][i]=t[7][i]=' ';
    }
    r(ii,8)cout<<t[ii]<<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;
	while (1)
	{
		cin >> n;
		if (cin.eof())
		{
			cout << '\b\b';
			break;
		}
		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;
		}
		cout << endl;
	}
}

C++: #include<iostream>
#include<vector>
#include<cstdio>
#define p push_back
using namespace std;
vector<char> v[10];

void solve(char c){
  if(0<=c-'0' && c-'0'<=4){
    v[0].p('*');
    v[1].p(' ');
  }
  else{
    v[0].p(' ');
    v[1].p('*');
   }
  v[2].p('=');
  if(c-'0' == 0){
    v[3].p(' ');v[4].p('*');v[5].p('*');v[6].p('*');v[7].p('*');
  }
  else if(c-'0' == 1){
 
  v[3].p('*');v[4].p(' ');v[5].p('*');v[6].p('*');v[7].p('*');
  }
 else if(c-'0' == 2){
 
  v[3].p('*');v[4].p('*');v[5].p(' ');v[6].p('*');v[7].p('*');
  }
 else if(c-'0' == 3){
 
  v[3].p('*');v[4].p('*');v[5].p('*');v[6].p(' ');v[7].p('*');

  }
 else if(c-'0' == 4){
 
  v[3].p('*');v[4].p('*');v[5].p('*');v[6].p('*');v[7].p(' ');
  }
 else if(c-'0' == 5){
 
  v[3].p(' ');v[4].p('*');v[5].p('*');v[6].p('*');v[7].p('*');
  }
 else if(c-'0' == 6){
  v[3].p('*');v[4].p(' ');v[5].p('*');v[6].p('*');v[7].p('*');
  }
 else if(c-'0' == 7){
 
  v[3].p('*');v[4].p('*');v[5].p(' ');v[6].p('*');v[7].p('*');
  }
 else if(c-'0' == 8){
 
  v[3].p('*');v[4].p('*');v[5].p('*');v[6].p(' ');v[7].p('*');
  }
 else if(c-'0' == 9){
   v[3].p('*');v[4].p('*');v[5].p('*');v[6].p('*');v[7].p(' ');
  }

} 


int main(){
  string s;
  bool air = false;
  while(cin >> s){
if(air)cout << endl;  
    air = true;

    for(int i=0;i<9;i++)v[i].clear();
    for(int i=0;i<s.length();i++){
      solve(s[i]);
    }
  
    for(int i=0;i<8;i++){
      for(int j=0;j<s.length();j++){
      	cout << v[i][j];
      }
      cout << endl;
    }
    
  }
  
  
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

char c[5];
string s;

int main(){
	while(cin>>s){
			for(int i=0;i<s.size();i++)s[i]-='0';
		for(int i=0;i<8;i++){
			for(int j=0;j<s.size();j++){
				if(i==0){
					if(s[j]<5)cout<<"*";
					else cout<<" ";
				}
				if(i==1){
					if(s[j]>4)cout<<"*";
					else cout<<" ";
				}
				if(i==2)cout<<"=";
				if(i>2){
					if(s[j]%5==i-3)cout<<" ";
					else cout<<"*";
				}
			}
			cout<<endl;
		}
	}
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>

using namespace std;

typedef long long ll;
typedef pair<string,int> P;

int main(){
	string str;
	string ge5[] = {"* -"," *-"};
	string lt5[] = {" ****","* ***","** **","*** *", "**** "};
	while(getline(cin,str)){
		vector<string> res;
		for(int i=str.size()-1;i>=0;i--){
			string tmp="";
			tmp = ge5[(str[i]-'0') >= 5 ? 1 : 0];
			tmp = tmp + lt5[(str[i]-'0') % 5];
			res.push_back(tmp);
		}

		while(res.size()<5) res.push_back(ge5[0]+lt5[0]);

		reverse(res.begin(),res.end());
		for(int i=0;i<res[0].size();i++){
			for(int j=0;j<res.size();j++){
				printf("%c%s",res[j][i],j==res.size()-1 ? "\n" : "");
			}
		}
	}
}