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 <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
int main()
{
	char s[6], r[5][8], d;
	int n = -1, i, j, c;
	while (1)
	{
		if (cin.eof()) break;
		if (n != -1) cout << endl;
		cin >> n;
		sprintf(s, "%05d", n);
		for (i = 0; i < 5; i++)
		{
			d = (char)s[i];
			c = atoi(&d);
			if (c < 5)
			{
				r[i][0] = '*';
				r[i][1] = ' ';
			}
			else
			{
				r[i][0] = ' ';
				r[i][1] = '*';
			}
			r[i][2] = '=';
			for (j = 3; j < 8; j++)
			{
				if (c != j-3 && c != j+2)
					r[i][j] = '*';
				else
					r[i][j] = ' ';
			}
		}
		for (i = 0; i < 8; i++)
		{
			for (j = 0; j < 5; j++)
			{
				cout << r[j][i];
			}
			cout << endl;
		}
	}
}

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

int main()
{
	int i, j, n[5];
	string s, letter[2] = {" ", "*"};
	stringstream ss;
	bool f = false;
	while (cin>>s) {
		if (f) cout<<endl;
		f = true;
		ss.str("");
		ss<<setw(5)<<setfill('0')<<right<<s;
		for (i = 0; i < 5; i++) n[i] = ss.str()[i]-'0';
		s = "";
		for (j = 0; j < 2; j++) {
			for (i = 0; i < 5; i++) {
				if (n[i]>=5) s += letter[j];
				else s += letter[(j+1)&1];
			}
			s += "\n";
		}
		for (i = 0; i < 5; i++) s += "=";
		s += "\n";
		for (j = 0; j < 5; j++) {
			for (i = 0; i < 5; i++) {
				if (n[i]%5==j) s += letter[0];
				else s += letter[1];
			}
			s += "\n";
		}
		cout<<s;
	}
	return 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&&i!=6) printf("\n");
			}
			puts("");
	}
	return 0;
}

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


std::string to_soroban(const int &n, const int &level = -1) {
	if (level == 5) {
		return "";
	}
	else if (level == -1) {
		auto rest = to_soroban(n, level + 1);
		std::string upper = "\n";
		std::string lower = "\n";
		int copy = n;
		for (auto i = 0; i < 5; ++i) {
			if (copy % 10 > 4) {
				upper = " " + upper;
				lower = "*" + lower;
			}
			else {
				upper = "*" + upper;
				lower = " " + lower;
			}
			copy /= 10;
		}
		return upper + lower + "=====\n" + rest;
	}
	else {
		auto rest = to_soroban(n, level + 1);
		std::string res = "\n";
		int copy = n;
		for (auto i = 0; i < 5; ++i) {
			if (copy % 5 == level) {
				res = " " + res;
			}
			else {
				res = "*" + res;
			}
			copy /= 10;
		}
		return res + rest;
	}
}
int main() {
	int j;
	std::cin >> j;
	std::cout << to_soroban(j);
	for (int i; std::cin >> i;) {
		std::cout << '\n' << to_soroban(i);
	}
	return 0;
}

C++: #include<stdio.h>

int main(void){
	int n,i,j;
	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");
			}
			printf("\n");
	}
	return 0;
}

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

int main(){

	int n;
	std::vector<int>v;
	while (std::cin >> n)v.push_back(n);

	for (int k = 0; k < v.size(); k++){
		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 = v[k] % 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] = ' ';

			v[k] /= 10;
		}

		for (int i = 0; i < 8; i++){
			bool flg = false;
			for (int j = 0; j < 5; j++)if (soro[i][j] != ' ')flg = true;

			if (flg){
				for (int j = 0; j < 5; j++){
					std::cout << soro[i][j];
				}
				std::cout << std::endl;
			}
			else std::cout << std::endl;
		}
		if (k != v.size() - 1)std::cout << std::endl;
	}
	return 0;
}

C++: #include<iostream>

int main()
{
	char abacus[8][5];
	
	bool first=true;
	while(1)
	{
		int num;
		std::cin>>num;
		if(std::cin.eof())break;
		
		for(int c=4;c>=0;c--)
		{
			int digit=num%10;
			num/=10;
			int q=digit/5;
			int s=digit%5;
			int i=0;
			if(q==1)
			{
				abacus[0][c]=' ';
				abacus[1][c]='*';
			}
			else
			{
				abacus[0][c]='*';
				abacus[1][c]=' ';
			}
			abacus[2][c]='=';
			
			for(i=3;i<3+s;i++)
			{
				abacus[i][c]='*';
			}
			abacus[i++][c]=' ';
			for(;i<8;i++)
			{
				abacus[i][c]='*';
			}
		}
		if(first){first=false;}
		else{std::cout<<std::endl;}
		for(int i=0;i<8;i++)
		{
			for(int j=0;j<5;j++)
			{
				std::cout<<abacus[i][j];
			}
			std::cout<<std::endl;
		}
	}
	return 0;
}