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

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

const int MAX = 5;

int len;
char num[MAX];
char field1[MAX][MAX], field2[2][MAX];
void change(int i) {
  
  if(num[i] % 5 == 1) { field1[1][i] = ' '; field1[0][i] = '*'; }
  if(num[i] % 5 == 2) { field1[2][i] = ' '; field1[0][i] = '*'; }
  if(num[i] % 5 == 3) { field1[3][i] = ' '; field1[0][i] = '*'; }
  if(num[i] % 5 == 4) { field1[4][i] = ' '; field1[0][i] = '*'; }
  if(num[i] >= 5) { field2[0][i] = ' '; field2[1][i] = '*'; }
  
}
  
int main() {
  char dumy[MAX];
  while(scanf("%s", dumy) != EOF) {
    
    memset(num, '#', sizeof(num));
    
    for(int i = 1 ; i < MAX ; i++)
      for(int j = 0 ; j < MAX ; j++) field1[i][j] = '*';
    
    for(int i = 0 ; i < MAX ; i++) field1[0][i] = ' ';

    for(int i = 0 ; i < MAX ; i++) {
      field2[0][i] = '*'; 
      field2[1][i] = ' ';
    }

    len = strlen(dumy);
    len = MAX - len;
    num[len] = dumy[0];
    if(len+1 < 5) num[len+1] = dumy[1];
    if(len+2 < 5) num[len+2] = dumy[2];
    if(len+3 < 5) num[len+3] = dumy[3];
    if(len+4 < 5) num[len+4] = dumy[4];

    for(int i = 4 ; i >= 0 ; i--) {
      if(num[i] != '#') {
	num[i] = num[i] - '0';
	change(i);
      }
    }
    
    for(int i = 0 ; i < 2 ; i++) {
      for(int j = 0 ; j < 5 ; j++) {
	cout << field2[i][j];
      }
      cout << endl;
    }
    cout << "=====" << endl;
    
    for(int i = 0 ; i < 5 ; i++) {
      for(int j = 0 ; j < 5 ; j++) {
	cout << field1[i][j];
      }
      cout << endl;
    }
    cout << endl;
    memset(num, '#', sizeof(num));
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

int main(){
  string s;
  int cnt=0;
  while(cin>> s){
    int ban[8][5]={0}; //0が空白,1がアスタリスク,2が=
    for(int i=0;i<8;i++){
      if(i==0 || i==4 || i==5 || i==6 || i==7){
	for(int j=0;j<5;j++){
	  ban[i][j]=1;
	}
      }
      else if(i==2){
	for(int j=0;j<5;j++){
	  ban[i][j]=2;
	}
      }
    }

    for(int i=0;i<s.size();i++){
      int x=i+(5-s.size());
      if(s[i]=='1'){
	ban[3][x]=1; ban[4][x]=0;
      }
      else if(s[i]=='2'){
	ban[3][x]=1; ban[5][x]=0;
      }
      else if(s[i]=='3'){
	ban[3][x]=1; ban[6][x]=0;
      }
      else if(s[i]=='4'){
	ban[3][x]=1; ban[6][x]=0;
      }
      else if(s[i]=='5'){
	ban[1][x]=1; ban[0][x]=0;
      }
      else if(s[i]=='6'){
	ban[1][x]=1; ban[0][x]=0;
	ban[3][x]=1; ban[4][x]=0;
      }
      else if(s[i]=='7'){
	ban[1][x]=1; ban[0][x]=0;
	ban[3][x]=1; ban[5][x]=0;
      }
      else if(s[i]=='8'){
	ban[1][x]=1; ban[0][x]=0;
	ban[3][x]=1; ban[6][x]=0;
      }
      else if(s[i]=='9'){
	ban[1][x]=1; ban[0][x]=0;
	ban[3][x]=1; ban[6][x]=0;
      }
    }
    if(cnt) cout<< endl;
    cnt++;
    for(int i=0;i<8;i++){
      for(int j=0;j<5;j++){
	//cout<< ban[i][j];
	if(ban[i][j]==0) cout<< " ";
	else if(ban[i][j]==1) cout<< '*';
	else if(ban[i][j]==2) cout<< '=';
      }
      cout<< endl;
    }
  }
}

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

char n[10][12]={
	"* = ****","* =* ***","* =** **","* =*** *","* =**** ",
	" *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "
};

int main(void){
	int i,j,set,x;
	char s[8];

	for(set=0;cin>>x && x;set++){
		if(set!=0) cout<<endl;
		sprintf(s,"%05d",x);

		for(i=0;i<8;i++){
			for(j=0;j<5;j++){
				cout<<n[s[j]-'0'][i];
			}
			cout<<endl;
		}
	}

	return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int a;
	while (cin >> a){
		int b[5] = { 0 };
		if (a < 10){
			b[4] = a;
		}
		else if (a < 100){
			b[4] = a % 10;
			a -= b[4];
			a /= 10;
			b[3] = a;
		}
		else if (a < 1000){
			b[4] = a % 10;
			a -= b[4];
			a /= 10;
			b[3] = a % 10;
			a -= b[3];
			a /= 10;
			b[2] = a;
		}
		else if (a < 10000){
			b[4] = a % 10;
			a -= b[4];
			a /= 10;
			b[3] = a % 10;
			a -= b[3];
			a /= 10;
			b[2] = a % 10;
			a -= b[2];
			a /= 10;
			b[1] = a;
		}
		else{
			b[4] = a % 10;
			a -= b[4];
			a /= 10;
			b[3] = a % 10;
			a -= b[3];
			a /= 10;
			b[2] = a % 10;
			a -= b[2];
			a /= 10;
			b[1] = a % 10;
			a -= b[1];
			a /= 10;
			b[0] = a;
		}
		for (int i = 0; i < 5; i++){
			if (b[i] < 5)cout << ' ';
			else cout << '*';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			if (b[i] < 5)cout << '*';
			else cout << ' ';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			cout << '=';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			if (b[i] % 5 == 0)cout << ' ';
			else cout << '*';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			if (b[i] % 5 == 1)cout << ' ';
			else cout << '*';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			if (b[i] % 5 == 2)cout << ' ';
			else cout << '*';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			if (b[i] % 5 == 3)cout << ' ';
			else cout << '*';
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			if (b[i] % 5 == 4)cout << ' ';
			else cout << '*';
		}
		cout << endl;
	}

}

C++: #include <iostream>
using namespace std;
int main(){
	string s="";
	while(cin >> s){
		if(s!="")cout<<"\n";
		string soroban[8];
		int n[5]={0};
		for(int i=0;i<8;++i)soroban[i]="";
		for(int i=5-s.size();i<5;++i)if('0'<=s[i-(5-s.size())]&&s[i-(5-s.size())]<='9')n[i]=s[i-(5-s.size())]-'0';
		for(int i=0;i<5;++i){
			soroban[0]+=(n[i]/5)?' ':'*';
			soroban[1]+=(n[i]/5)?'*':' ';
			soroban[2]+='=';
			for(int j=0;j<5;++j) soroban[3+j]+=(n[i]%5==j)?' ':'*';
		}
		for(int i=0;i<8;++i)cout << soroban[i] << "\n";
	}
	return 0;
}

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

string abacus(int x){
  string res;
  if(x<5)res += "* =";
  else res += " *=";

  if(x%5 == 0)res += " ****";
  if(x%5 == 1)res += "* ***";
  if(x%5 == 2)res += "** **";
  if(x%5 == 3)res += "*** *";
  if(x%5 == 4)res += "**** ";
  return res;
}
int main(){
  int x;

  while(cin>>x){
    string ans[5];
    for(int i=4;i>=0;i--){
      ans[i] = abacus(x%10);
      x /= 10;
    }
 
    for(int i=0;i<8;i++){
      for(int j=0;j<5;j++)cout << ans[j][i];
      cout << endl;
    }
    cout << endl;
  }
}

C++: #include<cstdio>
#include<cstring>
using namespace std;
int main(void)
{
	char ab[10][9]={"* = ****","* =* ***","* =** **","* =*** *",
					"* =**** "," *= ****"," *=* ***"," *=** **",
					" *=*** *"," *=**** "};
	char buf[9][6];
	int base[5]={10000,1000,100,10,1};
	int i,j,wk,x,n,flg;
	flg=1;
	while(scanf("%d",&x)!=EOF)	{
		for(i=0;i<5;i++)	{
			n=x/base[i];
			x=x%base[i];
			for(j=0;j<8;j++)	{
				buf[j][i]=ab[n][j];
			}
		}
		if(flg==0)	printf("\n");
		if(flg==1)	flg=0;
		for(i=0;i<8;i++)	{
			for(j=0;j<5;j++)	{
				printf("%c",buf[i][j]);
			}
			printf("\n");
		}
	}
	return 0;
}