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 <string>
#include <vector>
using namespace std;

int main()
{
  int n;
  bool first = true;
  while (cin >> n) {
    vector<string> ans(8, "");
    for (int keta = 0; keta < 5; ++keta) {
      int d = n % 10;
      
      if (d >= 5) {
	ans[0] = " " + ans[0];
	ans[1] = "*" + ans[1];
      } else {
	ans[0] = "*" + ans[0];
	ans[1] = " " + ans[1];
      }
      ans[2] += "=";

      for (int i = 0; i < 5; ++i) {
	if (i == d%5)
	  ans[i+3] = " " + ans[i+3];
	else
	  ans[i+3] = "*" + ans[i+3];
      }

      n /= 10;
    }
    if (!first)
      cout << endl;
    for (unsigned int i = 0; i < ans.size(); ++i)
      cout << ans[i] << endl;
    first = false;
  }
  return 0;
}

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

int main() {
	
	string s;
	string ab[10]={"* = ****","* =* ***","* =** **","* =*** *","* =**** "," *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "};
	string res[8];
	
	while(cin>>s){
		
		for(int i=0;i<8;++i)res[i]="";
		
		int l=s.length();
		
		for(int i=0;i<5-l;++i){
			s = "0" + s;
		}
		
		for(int j=0;j<5;++j){
			for(int i=0;i<8;++i){
				res[i] += ab[s[j]-'0'][i];
			}
		}
		for(int i=0;i<8;++i){
			cout<<res[i]<<endl;
		}
	}
	return 0;
}

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

int main(){
	int n;
	int pow10[]={10000,1000,100,10,1};
	while(!(cin>>n&&n))return 0;
	while(1){
		for(int i=0;i<2;i++){
			for(int j=0;j<5;j++){
				if(i==(5<=n/pow10[j]%10))cout<<'*';
				else cout<<' ';
			}
			cout<<endl;
		}
		cout<<"=====\n";
		for(int i=0;i<5;i++){
			for(int j=0;j<5;j++){
				if(n/pow10[j]%5==i)cout<<' ';
				else cout<<'*';
			}
			cout<<endl;
		}
		if(cin>>n&&n)cout<<endl;
		else break;
	}
	return 0;
}

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

int main(){
  int i,j,a,b,c;
  while(cin >> a){
    for(j=0;j<=5;j+=5){
      b = a;
      for(i=10000;i>=1;i/=10){
	if(b/i == j || b/i == j+1 || b/i == j+2 || b/i == j+3 || b/i == j+4) cout << "*";
	else cout << " ";

        c = b / i;
	b = b - c * i;

      }
      cout << endl;
    }
    
    cout << "=====" << endl;
    
    for(j=0;j<5;j++){
      b = a;
      for(i=10000;i>=1;i/=10){
	if(b/i == j || b/i == j+5) cout << " ";
	else cout << "*";

	c = b / i;
	b = b - c * i;

      }
      cout << endl;
    }
    cout << endl;
  }
  return 0;
}

C++: #include <string>
#include <iostream>
using namespace std;
string s; int c;
int main() {
	while(cin >> s) {
		if(c++) printf("\n");
		while(s.size() != 5) s = "0" + s;
		for(int i = 0; i < 5; i++) printf("%c", s[i] < '5' ? '*' : ' '); printf("\n");
		for(int i = 0; i < 5; i++) printf("%c", s[i] > '4' ? '*' : ' '); printf("\n");
		printf("=====\n");
		for(int i = 0; i < 5; i++) {
			for(int j = 0; j < 5; j++) printf("%c", (s[i] - 48) % 5 == i ? ' ' : '*'); pritf("\n");
		}
	}
}

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

int main(){
	int n,c,a,i,j,count=0;
	while(cin >> n){
		int b[8][5];
		c = 10000;
		for(i=0;i<5;i++){
			a = n/c;
			if(a<5) b[0][i] = 1;
			else b[1][i] = 1;
			b[2][i] = 2;
			if(a==0||a==5){
				for(j=4;j<8;j++){
					b[j][i] = 1;
				}
			}
			else if(a==1||a==6){
				for(j=3;j<8;j++){
					if(j==4) continue;
					b[j][i] = 1;
				}
			}
			else if(a==2||a==7){
				for(j=3;j<8;j++){
					if(j==5) continue;
					b[j][i] = 1;
				}
			}
			else if(a==3||a==8){
				for(j=3;j<8;j++){
					if(j==6) continue;
					b[j][i] = 1;
				}
			}
			else {
				for(j=3;j<7;j++){
					b[j][i] = 1;
				}
			}
			n -= c*a;
			c /= 10;
		}
		if(count) printf("\n");
		else count++;
		for(i=0;i<8;i++){
			for(j=0;j<5;j++){
				if(b[i][j] == 1) printf("%c",'*');
				else if(b[i][j] == 2) printf("%c",'=');
				else printf("%c",' ');
			}
			printf("\n");
		}
	}
	return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,s,b) for(int i=(s);i<(b);i++)
#define rrep(i,s,b) for(int i=(b)-1;i>=(s);i--)
#define all(s) (s).begin(),(s).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

signed main() {
	for (int n, cnt = 0; cin >> n; cnt++) {
		if (cnt)cout << endl;
		string s[5] = {};
		rep(i, 0, 5) {
			int a = n % 10;
			if (a >= 5)s[i] += " *=";
			else s[i] += "* =";
			a %= 5;
			rep(j, 0, 5) {
				if (j == a) s[i] += " ";
				s[i] += "*";
			}
			n /= 10;
		}
		rep(h, 0, s[0].size()) {
			string ans = "";
			//bool flag = true;
			rep(i, 0, 5) {
				//if (flag&&s[i][h] == ' ')continue;
				//flag = false;
				ans = s[i][h] + ans;
			}
			cout << ans << endl;
		}
	}
	return 0;
}

C++: #include <string>
#include <iostream>
using namespace std;
string s; int c;
int main() {
	while(cin >> s) {
		if(c++) printf("\n");
		while(s.size() != 5) s = "0" + s;
		for(int i = 0; i < 5; i++) printf("%c", s[i] < '5' ? '*' : ' '); printf("\n");
		for(int i = 0; i < 5; i++) printf("%c", s[i] > '4' ? '*' : ' '); printf("\n");
		printf("=====\n");
		for(int i = 0; i < 5; i++) {
			for(int j = 0; j < 5; j++) printf("%c", (s[j] - 48) % 5 == i ? ' ' : '*'); printf("\n");
		}
	}
}

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

string f[10] = {
	"* = ****",
	"* =* ***",
	"* =** **",
	"* =*** *",
	"* =**** ",
	" *= ****",
	" *=* ***",
	" *=** **",
	" *=*** *",
	" *=**** "
};

int main(){
	string s;
	bool flag = false;

	while( cin >> s ){
		string ans[10];
		if( flag ){
			cout << endl;
		}else{
			flag = true;
		}
		while( s.size() < 5 ){
			s = "0" + s;
		}

		for(int i=0 ; i < s.size() ; i++ ){
			ans[i] = f[s[i]-'0'];
		}
		for(int x=0 ; x < 8 ; x++ ){
			for(int y=0 ; y < s.size() ; y++ ){
				cout << ans[y][x];
			}
			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(i!=6 && j==4) printf("\n");
			}
	}
	return 0;
}