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<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) printf("\n");
			}
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<string>
using namespace std;int main(){int i,j=0,n[5];string s;char x[5],l[2]={' ','*'};while(cin>>i){if(j)cout<<endl;sprintf(x,"%05d",i);for(j=5;j-->0;)n[j]=x[j]-'0';s="";while(j++<1){for(i=0;i<5;i++)s+=l[j+(n[i]<5)&1];s+="\n";}for(j=5;j-->0;)s+="=";s+="\n";while(j++<4){for(i=0;i<5;i++)s+=l[n[i]%5!=j];s+="\n";}cout<<s;}return 0;}

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

using namespace std;

int main()
{
	char n[10][9]={"* = ****","* =* ***","* =** **","* =*** *","* =**** ",
				   " *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "};
	int a;
	for(int k=0;cin>>a;k++){
		if(k>0)	cout<<endl;

		char s[6];
		sprintf(s,"%05d",a);

		char abacus[8][6];
		for(int i=0;i<5;i++){
			for(int j=0;j<8;j++){
				abacus[j][i]=n[s[i]-'0'][j];
			}
		}

		for(int i=0;i<8;i++){
			for(int j=0;j<5;j++){
				cout<<abacus[i][j];
			}
			cout<<endl;
		}
	}

	return 0;
}

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

int main()
{
	bool aster[10][7]={0};
	for(int i=0; i<10; i++)
	{
		if(i<=4) aster[i][0]=1;
		else aster[i][1]=1;
	}
	
	for(int i=0; i<5; i++)
	for(int j=0; j<10; j++)
		if(i!=(j%5)) aster[j][i+2]=1;
	
	bool f=false;
	char buf[9];
	while(scanf("%s", buf) != EOF)
	{
		if(f) puts("");
		f=true;
		
		char str[9];
		int len=strlen(buf);
		for(int i=0; i<5; i++)
		{
			if(5-len<=i) str[i]=buf[i-(5-len)];
			else str[i]='0';
		}
		str[5]='\0';
		
		for(int i=0; i<7; i++)
		{
			for(int j=0; j<5; j++)
			{				
				if(aster[str[j]-'0'][i]) printf("*");
				else printf(" ");
			}
			puts("");
			if(i==1) puts("=====");
		}
	}
}

C++: #include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cctype>
#include<complex>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<functional>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<bitset>
#include<numeric>
#define INF 1e+8
#define EPS 1e-8
#define PB push_back
#define fi first
#define se second
#define reps(i,j,k) for(int i = j; i < k; i++)
#define rep(i,j) reps(i,0,j)
using namespace std;
const int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
typedef long long ll;
typedef pair<int,int> Pii;

int main(){
	string data;
	vector< string > type;
	type.PB("* = ****");
	type.PB("* =* ***");
	type.PB("* =** **");
	type.PB("* =*** *");
	type.PB("* =**** ");
	type.PB(" *= ****");
	type.PB(" *=* ***");
	type.PB(" *=** **");
	type.PB(" *=*** *");
	type.PB(" *=**** ");

	bool flg = false;
	while(cin >> data){
		vector < string > ans;
		string sub="";
		if(flg)puts("");
		rep(i,5-data.size())sub+="0";
		sub += data;
		swap(sub,data);
		rep(i,5){
			ans.PB(type[data[i]-48]);
		}
		rep(i,8){
			rep(j,5){
				cout << ans[j][i];
			}
			puts("");
		}
		flg = true;
	}
	return 0;
}

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

using namespace std;

void solve()
{
	vector<string> abacus(10);
	abacus[0] = "* = ****";
	abacus[1] = "* =* ***";
	abacus[2] = "* =** **";
	abacus[3] = "* =*** *";
	abacus[4] = "* =**** ";
	abacus[5] = " *= ****";
	abacus[6] = " *=* ***";
	abacus[7] = " *=** **";
	abacus[8] = " *=*** *";
	abacus[9] = " *=**** ";
	bool first = true;
	string input;
	while(cin >> input)
	{
		if(!first)
		{
			cout << endl;
		}
		first = false;
		string str;
		if(input.size() < 5)
		{
			for(int i = 0; i < 5 - input.size(); ++i)
			{
				str += "0";
			}
			str += input;
		}
		else
		{
			str = input;
		}
		vector<string> data(5);
		for(int i = 0; i < str.size(); ++i)
		{
			data[i] = abacus[str[i] - '0'];
		}
		for(int i = 0; i < 8; ++i)
		{
			for(int j = 0; j < 5; ++j)
			{
				cout << data[j][i];
			}
			cout << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}

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(str.empty()) continue;
		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]);

		char table[8][5];
		for(int i=0;i<res[0].size();i++){
			for(int j=0;j<res.size();j++){
				table[i][j]=res[j][i];
				//printf("%c%s",res[j][i],j==res.size()-1 ? "\n" : "");
			}
		}

		for(int i=0;i<res[0].size();i++){
			for(int j=0;j<res.size();j++){
				cout << table[i][j];
			}
			cout << endl;
		}
		isnl = true;
	}

	exit(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) printf("\n");
			}
			printf("     \n");
	}
	return 0;
}