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 "bits/stdc++.h"

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

int data[10][10]={ 	{1,0,2,0,1,1,1,1},
					{1,0,2,1,0,1,1,1},
					{1,0,2,1,1,0,1,1},
					{1,0,2,1,1,1,0,1},
					{1,0,2,1,1,1,1,0},
					{0,1,2,0,1,1,1,1},
					{0,1,2,1,0,1,1,1},
					{0,1,2,1,1,0,1,1},
					{0,1,2,1,1,1,0,1},
					{0,1,2,1,1,1,1,0},
				};

int main(){
	string n;
	int fie[8][5];
	bool f=false;
	while(cin>>n){
		if(f)cout<<endl;
		else f=true;
		rep(i,5)rep(j,8){
			fie[j][i]=data[0][j];
		}
		int len = n.size();

		for(int i=5-len;i<5;i++){
			rep(j,8){
				fie[j][i]=data[n[i-(5-len)]-'0'][j];
			}
		}
		rep(i,8){
			rep(j,5){
				if(fie[i][j]==1){
					cout<<'*';
				}else if(fie[i][j]==2){
					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[] = {" ****","* ***","** **","*** *", "**** "};
	bool isnl=false;
	while(getline(cin,str)){
		if(isnl) cout << endl;
		vector<string> res;

		while(str.size()<5) str = "0" + str;
		for(int i=0;i<str.size();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]);

		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" : "");
			}
		}
		isnl = true;
	}
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
int main()
{
	char s[6], r[5][8], d;
	int n = -1, i, j, c;
	while (1)
	{
		if (cin.eof()) break;
		if (n != -1) cout << endl;
		cin >> n;
		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;
		}
	}
}

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

int main()
{
	int i, j, n[5];
	string s, letter[2] = {" ", "*"};
	stringstream ss;
	bool f = false;
	while (cin>>s) {
		if (f) cout<<endl;
		f = true;
		ss.str("");
		ss<<setw(5)<<setfill('0')<<right<<s;
		for (i = 0; i < 5; i++) n[i] = ss.str()[i]-'0';
		s = "";
		for (j = 0; j < 2; j++) {
			for (i = 0; i < 5; i++) {
				if (n[i]>=5) s += letter[j];
				else s += letter[(j+1)&1];
			}
			s += "\n";
		}
		for (i = 0; i < 5; i++) s += "=";
		s += "\n";
		for (j = 0; j < 5; j++) {
			for (i = 0; i < 5; i++) {
				if (n[i]%5==j) s += letter[0];
				else s += letter[1];
			}
			s += "\n";
		}
		cout<<s;
	}
	return 0;
}

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");
			}
			puts("");
	}
	return 0;
}

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


std::string to_soroban(const int &n, const int &level = -1) {
	if (level == 5) {
		return "";
	}
	else if (level == -1) {
		auto rest = to_soroban(n, level + 1);
		std::string upper = "\n";
		std::string lower = "\n";
		int copy = n;
		for (auto i = 0; i < 5; ++i) {
			if (copy % 10 > 4) {
				upper = " " + upper;
				lower = "*" + lower;
			}
			else {
				upper = "*" + upper;
				lower = " " + lower;
			}
			copy /= 10;
		}
		return upper + lower + "=====\n" + rest;
	}
	else {
		auto rest = to_soroban(n, level + 1);
		std::string res = "\n";
		int copy = n;
		for (auto i = 0; i < 5; ++i) {
			if (copy % 5 == level) {
				res = " " + res;
			}
			else {
				res = "*" + res;
			}
			copy /= 10;
		}
		return res + rest;
	}
}
int main() {
	int j;
	std::cin >> j;
	std::cout << to_soroban(j);
	for (int i; std::cin >> i;) {
		std::cout << '\n' << to_soroban(i);
	}
	return 0;
}

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;
}