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<stdio.h>

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

	while(scanf("%d",&n)!=EOF){

		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) printf("\n");
			}
		//	printf("\n");
	}
	return 0;
}

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

string abacus[] = {
    "* = ****",
    "* =* ***",
    "* =** **",
    "* =*** *",
    "* =**** ",
    " *= ****",
    " *=* ***",
    " *=** **",
    " *=*** *",
    " *=**** "
};

void print(int n) {
    vector<string> v;
    for (int k=10000; k>=1; k/=10) {
        v.push_back(abacus[n / k]);
        n %= k;
    }
    for (int i=0; i<8; ++i) {
        for (int j=0; j<5; ++j) {
            cout << v[j][i];
        }
        cout << endl;
    }
}

int main() {
    int n;
    bool lf = false;
    while (cin >> n) {
        if (lf) cout << endl;
        print(n);
        lf = true;
    }
    return 0;
}

C++: #include<iostream>

int main(){

	int n;
	while (std::cin >> n){

		char soro[8][5];
		for (int i = 0; i < 8; i++){
			for (int j = 0; j < 5; j++){
				soro[i][j] = '*';
			}
		}
		for (int i = 0; i < 5; i++)soro[2][i] = '=';

		for (int i = 4; i >= 0; i--){
			int mod = n % 10;

			if (mod == 0 || mod == 5)soro[3][i] = ' ';
			if (mod == 1 || mod == 6)soro[4][i] = ' ';
			if (mod == 2 || mod == 7)soro[5][i] = ' ';
			if (mod == 3 || mod == 8)soro[6][i] = ' ';
			if (mod == 4 || mod == 9)soro[7][i] = ' ';

			if (mod < 5)soro[1][i] = ' ';
			else soro[0][i] = ' ';

			n /= 10;
		}

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



}

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

int main()
{
	int c=0,n,str[5];
	while(cin >> n)
	{
		if(c) cout << endl; c=1;

		for(int i=0,k=10000; i<5; i++,k/=10)
		{
			str[i] = n/k;
			n %= k;
		}


		for(int j=0; j<2; j++)
		{
			for(int i=0; i<5; i++)
			{
				cout << (str[i]/5==j?'*':' ');
			}
			cout << endl;
		}
	
		for(int i=0; i<5; i++) cout << '='; cout << endl;
		
		for(int j=0; j<5; j++)
		{
			for(int i=0; i<5; i++)
			{
				cout << (str[i]%5==j?' ':'*');
			}
			cout << endl;
		}
	}
}

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

int main(){
	string S,a[10] = {"* = ****","* =* ***","* =** **","* =*** *","* =****"," *= ****"," *=* ****"," *=** **"," *=*** *"," *=****"};
	while(cin>>S){
		for(int i=0;i<8;i++){
			for(int j=0;j<S.size();j++){
				printf("%c",a[S[j]-'0'][i]);
			}puts("");
		}
	}
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <ctype.h>
#include <string>
#include <iostream>
#include <vector>
#include <stack>
#include <fstream>
#include <sstream>
#include <queue>
#include <exception>
#include <cmath>
#include <numeric>
#include <map>
#include <algorithm>
#include <bitset>
#include <set>
#include <functional>

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

using namespace std;
typedef long long int lint;

string abacus[] = { "* = ****","* =* ***","* =** **","* =*** *","* =**** "," *= ****"," *=* ***"," *=** **"," *=*** *"," *=****" };

bool AOJ0128(bool flag)
{
	int n;
	if (!(cin >> n)) return false;

	char pic[8][5] = { 0 };
	RREP(j, 5) {
		int m = n % 10;
		REP(i, 8) {
			pic[i][j] = abacus[m][i];
		}
		n /= 10;
	}

	if (true) cout << endl;

	REP(i, 8) {
		REP(j, 5) {
			cout << pic[i][j];
		}
		cout << endl;
	}

	return true;
}

int main()
{
	bool flag = false;
	while (AOJ0128(flag)) {
		flag = true;
	}

	return 0;
}

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

class Soroban_col
{
  public:
    Soroban_col();
    ~Soroban_col();

  public:
    void Show(int i);
    void Set(int n);

  private:
    char* m_soroban_col;
};

Soroban_col::Soroban_col()
{
  m_soroban_col = new char[8];
}

Soroban_col::~Soroban_col()
{
  delete[] m_soroban_col;
}

void Soroban_col::Show(int i)
{
  cout << m_soroban_col[i];
}

void Soroban_col::Set(int n)
{
  if (n < 5)
  {
    m_soroban_col[0] = '*';
    m_soroban_col[1] = ' ';
  }
  else
  {
    m_soroban_col[0] = ' ';
    m_soroban_col[1] = '*';
  }

  m_soroban_col[2] = '=';

  for (int i = 3; i < 3 + n % 5; ++i)
  {
    m_soroban_col[i] = '*';
  }
  m_soroban_col[3+n%5] = ' ';
  for (int i = 4 + n % 5; i < 8; ++i)
  {
    m_soroban_col[i] = '*';
  }
}

class Soroban
{
  public:
    Soroban(int n);
    ~Soroban();

  public:
    void Show();

  private:
    Soroban_col* m_soroban;
};

Soroban::Soroban(int n)
{
  m_soroban = new Soroban_col[5];
  for (int i = 5; i > 0; --i)
  {
    int buf = (n % (int)pow(10, i) ) / (int)pow(10, i-1);
    m_soroban[5-i].Set(buf);
  }
}

Soroban::~Soroban()
{
  delete[] m_soroban;
}

void Soroban::Show()
{
  for (int i = 0; i < 8; ++i)
  {
    for (int j = 0; j < 5; ++j)
    {
      m_soroban[j].Show(i);
    }
    cout << endl;
  }
}

int main(void)
{
  int n;
  cin >> n;
  while (true)
  {
    Soroban soroban(n);
    soroban.Show();
    cin >> n;
    if (cin.eof()) break;
    cout << endl;
  }
  return 0;
}

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

int main()
{
	bool aster[10][7]={0};
	for(int i=0; i<10; i++)
	{
		if(i<=4) aster[i][0]=1;
		else aster[i][1]=1;
	}
	
	for(int i=0; i<5; i++)
	for(int j=0; j<10; j++)
		if(i!=(j%5)) aster[j][i+2]=1;
	
	bool f=false;
	char buf[9];
	while(scanf("%s", buf) != EOF)
	{
		if(f) puts("");
		f=true;
		
		char str[9];
		int cnt[7]={0}, len=strlen(buf);
		for(int i=0; i<5; i++)
		{
			if(5-len<=i) str[i]=buf[i-(5-len)];
			else str[i]='0';
		}
		str[5]='\0';
		
		for(int i=0; i<7; i++)
		for(int j=0; j<5; j++)
		{
			if(aster[str[j]-'0'][i]) cnt[i]++;
		}
		
		for(int i=0; i<7; i++)
		{
			for(int j=0; j<5; j++)
			{
				if(cnt[i]==0) break;
				
				if(aster[str[j]-'0'][i]) printf("*");
				else printf(" ");
			}
			puts("");
			if(i==1) puts("=====");
		}
	}
}