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>
using namespace std;

int main(void){
	int n;
	while(cin>>n){
		int in[5];
		in[0] = n / 10000	% 10;
		in[1] = n / 1000	% 10;
		in[2] = n / 100		% 10;
		in[3] = n / 10	 	% 10;
		in[4] = n / 1 		% 10;
//		for(int i = 0 ;  i < 5 ; i ++)cout<<int(in[i])<<" ";
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]<5)cout<<"*";
			else cout<<" ";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]>=5){cout<<"*";in[i]-=5;}
			else cout<<" ";
		cout<<endl;
		
		for(int i = 0 ; i < 5 ; i ++)
			cout<<"=";
		cout<<endl;
		
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==0)cout<<" ";
			else cout<<"*";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==1)cout<<" ";
			else cout<<"*";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==2)cout<<" ";
			else cout<<"*";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==3)cout<<" ";
			else cout<<"*";
		cout<<endl;
		for(int i = 0 ; i < 5 ; i ++)
			if(in[i]==4)cout<<" ";
			else cout<<"*";
		cout<<endl;
		cout<<endl;
	}
}

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

int main(){
	int n,c,a,i,j;
	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;
				b[1][i] = 0;
			}
			else {
				b[0][i] = 0;
				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;
		}
		for(i=0;i<8;i++){
			for(j=0;j<5;j++){
				if(b[i][j] == 1) cout << "*";
				else if(b[i][j] == 2) cout << "=";
				else cout << ' ';
				b[i][j] = 0;
			}
			cout << '\n';
		}
	}
	return 0;
}

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

int main(){
	int n;
	int pow10[]={10000,1000,100,10,1};
	while(!(cin>>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)cout<<endl;
		else break;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
main(){
  int i=0;
  string s;
  while(cin>>s){
    string t[8];
    r(ii,5){
      r(j,8){
        if(j==2)t[j]+='=';
        else t[j]+='*';
      }
    }
    for(i=0;i<5-s.size();i++)
      t[1][i]=t[3][i]=' ';
    for(;i<5;i++){
      int p=s[i-(5-s.size())]-'0';cout<<p;
      if(p==0)t[1][i]=t[3][i]=' ';
      if(p==1)t[1][i]=t[4][i]=' ';
      if(p==2)t[1][i]=t[5][i]=' ';
      if(p==3)t[1][i]=t[6][i]=' ';
      if(p==4)t[1][i]=t[7][i]=' ';
      if(p==5)t[0][i]=t[3][i]=' ';
      if(p==6)t[0][i]=t[4][i]=' ';
      if(p==7)t[0][i]=t[5][i]=' ';
      if(p==8)t[0][i]=t[6][i]=' ';
      if(p==9)t[0][i]=t[7][i]=' ';
    }
    r(ii,8)cout<<t[ii]<<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){
		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");
			}
	}
	return 0;
}

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

while(cin>>str){
int t=5-str.size();

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

char y=str[i-t];


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

for(int j=0;j<9;j++){

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

}
	
}

for(int i=0;i<9;i++){
for(int j=0;j<5;j++)
cout<<ch[i][j];

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

C++: #include <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  string s;
  int flag = 0;
  while (cin >> s) {
    if (flag++) cout << endl;
    while (int(s.size()) < 5) s = "0" + s;
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < 5; j++) {
        cout << " *"[i ^ ((s[j] - '0') / 5 == 0)];
      }
      cout << endl;
    }
    for (int i = 0; i < 5; i++) {
      cout << "=";
    }
    cout << endl;
    for (int i = 0; i < 5; i++) {
      for (int j = 0; j < 5; j++) {
        cout << " *"[(s[j] - '0') % 5 != i];
      }
      cout << endl;
    }
  }

  return 0;
}

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

int main(void)
{
	char abacus[8][10] = {
		"*****     ",
		"     *****",
		"==========",
		" **** ****",
		"* **** ***",
		"** **** **",
		"*** **** *",
		"**** **** ",
	};
	
	int n;
	bool flag = false;
	while (scanf("%d", &n) != EOF){
		int num[5];
		char a[8][5];
		for (int i = 0; i < 5; i++){
			num[4 - i] = n % 10;
			n /= 10;
		}
		for (int i = 0; i < 8; i++){
			for (int j = 0; j < 5; j++){
				a[i][j] = abacus[i][num[j]];
			}
		}
		
		if (flag){
			cout << endl;
		}
		
		for (int i = 0; i < 8; i++){
			for (int j = 0; j < 5; j++){
				cout << a[i][j];
			}
			cout << endl;
		}
		flag = true;
	}
	
	return (0);
}