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()
		}
		fmt.Println()
	}
}

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

using namespace std;

int main() {
    int n = 0;
    int N[5] = {0};
    cin >> n;
    
    N[0] = n / 10000;
    n %= 10000;
    N[1] = n / 1000;
    n %= 1000;
    N[2] = n / 100;
    n %= 100;
    N[3] = n / 10;
    n %= 10;
    N[4] = n;
    
    for(int i = 0; i < 8; i++) {
        for (int j = 0; j < 5; j++) {
            if(i == 0) {
                if (N[j] < 5) cout << "*";
                else cout << " ";
            }
            if(i == 1) {
                if (N[j] < 5) cout << " ";
                else cout << "*";
            }
            
            if(i == 2) cout << "=";
            
            if(i == 3) {
                if (N[j] > 4) N[j] -= 4;
                if (N[j] != 0) cout << "*";
                else cout << " ";
            }
            
            if(i == 4) {
                if (N[j] != 1) cout << "*";
                else cout << " ";
            }
            
            if(i == 5) {
                if (N[j] != 2) cout << "*";
                else cout << " ";
            }
            if(i == 6) {
                if (N[j] != 3) cout << "*";
                else cout << " ";
            }
            if(i == 7) {
                if (N[j] != 4) cout << "*";
                else cout << " ";
            }
            
            if (j == 4) cout << "\n";
        }        
    }
    
    return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main() {
	string s, ans[10] = {
		"* = ****",
		"* =* ***",
		"* =** **",
		"* =*** *",
		"* =**** ",
		" *= ****",
		" *=* ***",
		" *=** **",
		" *=*** *",
		" *=**** "
	};
	while(cin >> s) {
		cout << endl;
		while(s.size() < 5) {
			s = '0' + s;
		}
		for(int i = 0; i < 8; ++i) {
			for(int j = 0; j < 5; ++j) {
				cout << ans[s[j] - '0'].at(i);
			}
			cout << endl;
		}
	}
}

C++: #include<stdio.h>
#include<string>
#include<iostream>
using namespace std;

int main(){
string str;

char ch[10][6];
char n1[10]="* =* ***";
char n2[10]="* =** **";
char n3[10]="* =*** *";
char n4[10]="* =**** ";
char n5[10]=" *= ****";
char n6[10]=" *=* ***";
char n7[10]=" *=** **";
char n8[10]=" *=*** *";
char n9[10]=" *=**** ";
char n0[10]="* = ****";
char nn[10];
bool first=true;
while(cin>>str){

	if(first==false)cout<<endl;
	first=false;
int t=5-str.size();
bool f=true;

for(int i=0;i<5;i++){
	if(i<t){		
	for(int j=0;j<8;j++)
	nn[j]=n0[j];
	f=false;
}
	else{

char y=str[i-t];


if(y=='0'){
	for(int j=0;j<8;j++)
	nn[j]=n0[j];
}
else if(y=='1'){
	for(int j=0;j<8;j++)nn[j]=n1[j];
}
else if(y=='2'){
	for(int j=0;j<8;j++)nn[j]=n2[j];
}
else if(y=='3'){
	for(int j=0;j<8;j++)nn[j]=n3[j];
}
else if(y=='4'){
	for(int j=0;j<8;j++)nn[j]=n4[j];
}
else if(y=='5'){
	for(int j=0;j<8;j++)nn[j]=n5[j];
}
else if(y=='6'){
	for(int j=0;j<8;j++)nn[j]=n6[j];
}
else if(y=='7'){
	for(int j=0;j<8;j++)nn[j]=n7[j];
}
else if(y=='8'){
	for(int j=0;j<8;j++)nn[j]=n8[j];
}
else if(y=='9'){
	for(int j=0;j<8;j++)nn[j]=n9[j];
}
	if(y!='9'&&y!='4')f=false;
	}
	
for(int j=0;j<8;j++){

ch[j][i]=nn[j];

}
	
}
int w=8;
//	if(f==true)w=7;
for(int i=0;i<w;i++){
for(int j=0;j<5;j++)
cout<<ch[i][j];

cout<<endl;
}

}
return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

string s;
string table[] = { "*****     ", "     *****", "==========",
" **** ****", "* **** ***", "** **** **", "*** **** *", "**** **** " };

int main(){
	while (cin >> s){
		bool f = 0;
		if (f)cout << endl;
		reverse(ALL(s));
		REP(i, 4){
			s += "0";
			if (s.size() >= 5)break;
		}
		reverse(ALL(s));
		REP(i, 8){
			REP(j, s.size()){
				cout << table[i][s[j] - '0'];
			}
			cout << endl;
		}
		f = 1;
	}
}

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];
	while(cin>>n){
		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++: #include<stdio.h>

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

	while(scanf("%d",&n)!=EOF){
		//if(k!=0) printf("\n");
		//k++;
		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>

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

	}



}