Problem:
そろばん
そろばんを習い始める友人からのお願いで、あなたはそろばんの珠の並び
を表示するプログラムを作成することになりました。ある数字を入力として、そろばんの珠の並びを出力するプログラムを作成してください。ただし、表示するそろばんの桁数は 5 桁とし、0 から 9 までの珠の配置はそれぞれ '
*
' (半角アスタリスク)、'
' (半角空白)、'
=
' (半角イコール) を用いて以下のように表すものとします。
Input
複数のテストケースが与えられます。各テストケースとして 5 桁までの数字（整数）が １ 行に与えられます。
テストケースの数は 1024 を超えません。
Output
各テストケースついてそろばんの珠の配置を出力してください。テストケースの間に１行の空行を入れてください。
Sample Input
2006
1111
Output for the Sample Input
**** 
    *
=====
 *  *
**** 
* ***
*****
*****

*****

=====
 ****
*    
*****
*****
*****

Submitted solutions:

code_snippet: #include<iostream>
#include<algorithm>
using namespace std;

int main(){
	bool f=false;
	int n,i,j;
	int a[6];
	char a0[11][10]={"* = ****","* =* ***","* =** **","* =*** *","* =**** "," *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "};
	while(cin>>n){
		if(f==true) {cout<<endl;}
	a[0]=n/10000;
	a[1]=(n-a[0]*10000)/1000;
	a[2]=(n-a[0]*10000-a[1]*1000)/100;
	a[3]=(n-a[0]*10000-a[1]*1000-a[2]*100)/10;
	a[4]=(n-a[0]*10000-a[1]*1000-a[2]*100-a[3]*10);
	for(i=0;i<8;i++){
		for(j=0;j<5;j++){
			cout<<a0[a[j]][i];
		}
		cout<<endl;
	}
	f=true;
	}
	return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 1152
final_rank: 1

code_snippet: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }

string str;
char res[8][5];

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

int main() {
  bool start = true;
  while (cin >> str) {
    if (!start) cout << endl;
    while (str.size() < 5) str = "0" + str;
    for (int i = 0; i < 5; ++i) {
      int j = str[i] - '0';
      for (int k = 0; k < conv[j].size(); ++k) {
	res[k][i] = conv[j][k];
      }
    }
    for (int i = 0; i < 8; ++i) {
      for (int j = 0; j < 5; ++j) {
	cout << res[i][j];
      }
      cout << endl;
    }
    start = false;
  }
}
accuracy: 1
time_ms: 10
memory_kb: 1188
final_rank: 11

code_snippet: #include<iostream>
#include<string>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

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

int main(){
	string s;
	int cnt=0;
	while(cin>>s){
		if(cnt>0)cout<<endl;
		if(s.size()<5){
			while(s.size()<5){
				s='0'+s;
			}
		}
		rep(i,8){
			string temp="";
			rep(j,s.size()){
				temp+=num[s[j]-'0'][i];
			}
			cout<<temp<<endl;
		}
		cnt++;
	}
	return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 1188
final_rank: 11

code_snippet: #include<iostream>
#include<string>
using namespace std;
string s[10]={"* = ****","* =* ***","* =** **","* =*** *","* =**** "," *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "};
int main(){
	string d;
	int c[5];
	bool first=true;
	while(cin>>d){
		if(!first)cout<<endl;
		first=false;
		for(int i=0;i<5;i++)c[i]=0;
		for(int i=0;i<d.size();i++)c[5-d.size()+i]=d[i]-'0';
		for(int i=0;i<8;i++){for(int j=0;j<5;j++)cout<<s[c[j]][i];cout<<endl;}
	}
	return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 1184
final_rank: 7

code_snippet: #include<iostream>
#include<string>
using namespace std;
string s[10]={
	"* = ****",
	"* =* ***",
	"* =** **",
	"* =*** *",
	"* =**** ",
	" *= ****",
	" *=* ***",
	" *=** **",
	" *=*** *",
	" *=**** "
};
int main(){
	string d;
	int c[5];
	bool first=true;
	while(cin>>d){
		if(!first)cout<<endl;
		first=false;
		for(int i=0;i<5;i++)c[i]=0;
		for(int i=0;i<d.size();i++)c[5-d.size()+i]=d[i]-'0';
		for(int i=0;i<8;i++){
			for(int j=0;j<5;j++){
				cout<<s[c[j]][i];
			}
			cout<<endl;
		}
	}
	return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 1184
final_rank: 7

code_snippet: #include <iostream>
#include <cstdio>
using namespace std;

int main(void)
{
	char abacus[8][11] = {
		"*****     ",
		"     *****",
		"==========",
		" **** ****",
		"* **** ***",
		"** **** **",
		"*** **** *",
		"**** **** ",
	};
	
	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);
}
accuracy: 1
time_ms: 10
memory_kb: 1200
final_rank: 15

code_snippet: #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;
		}
	}
}
accuracy: 1
time_ms: 10
memory_kb: 1188
final_rank: 11

code_snippet: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

int n;
string s;
string table[] = { "*****     ", "     *****", "==========",
" **** ****", "* **** ***", "** **** **", "*** **** *", "**** **** " };
bool f = 0;

int main(){
	while (cin >> s){
		if (f)cout << endl;
		reverse(ALL(s));
		REP(i, 4){
			if (s.size() >= 5)break;
			s += "0";
		}
		reverse(ALL(s));
		REP(i, 8){
			REP(j, s.size()){
				cout << table[i][s[j] - '0'];
			}
			cout << endl;
		}
		f = 1;
	}
}
accuracy: 1
time_ms: 10
memory_kb: 1184
final_rank: 7

code_snippet: // 0128
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;

void abacus(int num[]){
	for(int j=0;j<2;j++){
		for(int i=0;i<5;i++)
			if((5*j <= num[i]) && (num[i] < 5*(j+1)))
				cout<<"*";
			else
				cout<<" ";
		cout<<endl;
	}

	for(int i=0;i<5;i++)
		cout<<"=";
	cout<<endl;

	for(int j=0;j<5;j++){
		for(int i=0;i<5;i++)
			if(num[i]%5 == j)
				cout<<" ";
			else
				cout<<"*";
		cout<<endl;
	}
}

int main(){

	int n, count = 0;
	while(scanf("%d", &n) != EOF){
		if(count != 0)
			cout<<endl;

		int num[5];
		for(int i=0;i<5;i++){
			num[4-i] = n%10;
			n /= 10;
		}
		
		abacus(num);

		count++;
	}

	return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 1200
final_rank: 15

code_snippet: #include<iostream>
#include<string>
#include<cmath>
using namespace std;
int a[5], b[5], c, cnt;
int main() {
	while (cin >> c) {
		if (cnt) { cout << endl; }
		cnt++;
		for (int i = 0; i < 5; i++) {
			a[4 - i] = ((c / (int)pow(10, i)) % 10) / 5;
			b[4 - i] = (c / (int)pow(10, i)) % 5;
		}

		for (int i = 0; i < 5; i++) {
			if (a[i] == 0) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;

		for (int i = 0; i < 5; i++) {
			if (a[i] == 1) {
				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] != 0) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;

		for (int i = 0; i < 5; i++) {
			if (b[i] != 1) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;

		for (int i = 0; i < 5; i++) {
			if (b[i] != 2) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;

		for (int i = 0; i < 5; i++) {
			if (b[i] != 3) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;

		for (int i = 0; i < 5; i++) {
			if (b[i] != 4) {
				cout << '*';
			}
			else {
				cout << ' ';
			}
		}
		cout << endl;
	}
}
accuracy: 1
time_ms: 10
memory_kb: 1200
final_rank: 15

code_snippet: #include <cstdio>
#include <iostream>
#include <string>
#include <map>
#define rep(i, n) for (int i=0; i<n; i++)
using namespace std;

string inp, ans[8];
map<char, string> m;

int main(void)
{
	m['0'] = "* = ****";
	m['1'] = "* =* ***";
	m['2'] = "* =** **";
	m['3'] = "* =*** *";
	m['4'] = "* =**** ";
	m['5'] = " *= ****";
	m['6'] = " *=* ***";
	m['7'] = " *=** **";
	m['8'] = " *=*** *";
	m['9'] = " *=**** ";

	bool first = true;

	while (cin >> inp)
	{
		if (first)
		{
			first = false;
		} else {
			cout << endl;
		}

		ans[5] = "        ";
		ans[6] = "        ";
		ans[7] = "        ";

		while (inp.length() < 5) inp = "0" + inp;
		rep(i, 5) ans[i] = m[inp[i]];
		//rep(i, 5) cout << ans[i] << endl;
		rep(i, 5)
		{
			rep(j, 8)
			{
				if (j < 5 && i < j) continue;
				char w = ans[i][j];
				ans[i][j] = ans[j][i];
				ans[j][i] = w;
			}
		}
		rep(i, 8)
		{
			rep(j, 5)
			{
				cout << ans[i][j];
			}
			cout << endl;
		}
	}
	
	return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 1188
final_rank: 11

code_snippet: #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()

#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,a,b) for(int i=(a); i<(b); i++)

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
const int IMAX=((1<<30)-1)*2+1;
const double EPS=1e-10;
//int mod=1000000007


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



int main(){
	int n;
	//string t;
	bool f=false;
	while(cin>>n){
		if(f)cout<<endl;
		else f=true;
		for(int i=0; i<8; i++){
			string t;
			for(int j=n; j>0; j/=10){
				t+=s[(j%10)][i];
			}
			for(int j=t.size(); j<5; j++){
				t+=s[0][i];
			}
			reverse(all(t));
			cout<<t<<endl;
		}
	}
}
accuracy: 1
time_ms: 10
memory_kb: 1204
final_rank: 19

code_snippet: #include "bits/stdc++.h"

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

int data[10][10]={ 	{1,0,2,0,1,1,1,1},
					{1,0,2,1,0,1,1,1},
					{1,0,2,1,1,0,1,1},
					{1,0,2,1,1,1,0,1},
					{1,0,2,1,1,1,1,0},
					{0,1,2,0,1,1,1,1},
					{0,1,2,1,0,1,1,1},
					{0,1,2,1,1,0,1,1},
					{0,1,2,1,1,1,0,1},
					{0,1,2,1,1,1,1,0},
				};

int main(){
	string n;
	int fie[8][5];
	bool f=false;
	while(cin>>n){
		if(f)cout<<endl;
		else f=true;
		rep(i,5)rep(j,8){
			fie[j][i]=data[0][j];
		}
		int len = n.size();

		for(int i=5-len;i<5;i++){
			rep(j,8){
				fie[j][i]=data[n[i-(5-len)]-'0'][j];
			}
		}
		rep(i,8){
			rep(j,5){
				if(fie[i][j]==1){
					cout<<'*';
				}else if(fie[i][j]==2){
					cout<<'=';
				}else cout<<' ';
			}
			cout<<endl;
		}
	}
}
accuracy: 1
time_ms: 10
memory_kb: 1172
final_rank: 2

code_snippet: #include <iostream>
#include <stdio.h>
#include <utility>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
string num[10]={
	"* = ****",
	"* =* ***",
	"* =** **",
	"* =*** *",
	"* =**** ",
	" *= ****",
	" *=* ***",
	" *=** **",
	" *=*** *",
	" *=**** ",
};
int main()
{
    int n;
	int a[5];
	bool first=true;
	while(cin>>n){
		if(!first)cout<<endl;
		a[0]=n/10000;
		a[1]=(n/1000)%10;
		a[2]=(n/100)%10;
		a[3]=(n/10)%10;
		a[4]=n%10;
		for(int i=0;i<8;i++){
			for(int j=0;j<5;j++){
				cout<<num[a[j]][i];
			}
			cout<<endl;
		}
		first=false;
	}
    return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 1200
final_rank: 15

code_snippet: #include<iostream>
#include<string>
#include<sstream>
using namespace std;

int main(){
	string str;
	string s[8];
	s[0] = "*****     ";
	s[1] = "     *****";
	s[2] = "==========";
	s[3] = " **** ****";
	s[4] = "* **** ***";
	s[5] = "** **** **";
	s[6] = "*** **** *";
	s[7] = "**** **** ";
	bool flag = false;
	while(cin >> str){
		if(flag) cout << endl;
		int len = str.size();
		int num[5]={0};
		int cou=0;
		for(int i=5-len;i<5;i++){
			string tmp = "";
			tmp += str[cou];
			istringstream ss(tmp);
			ss >> num[i];
			cou++;
		}
		for(int i=0;i<8;i++){
			for(int j=0;j<5;j++){
				cout << s[i][num[j]];
			}
			cout << endl;
		}
		flag = true;
	}
}
accuracy: 1
time_ms: 10
memory_kb: 1212
final_rank: 20

code_snippet: #include <iostream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,b) FOR(i,0,b)
#define PB push_back
#define MP make_pair
int main(){
  string data[10]={"* = ****","* =* ***","* =** **","* =*** *","* =**** "," *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "};
  string s;
  int n=0;
  while(cin>>s){
    if(n!=0)cout<<endl;
    n=1;
    string ans[5];
    for(int i=0;i<5-s.size();i++)ans[i]="* = ****";
    int k=5-s.size();
    for(int i=0;i<s.size();i++){
      ans[k]=data[s[i]-'0'];
      k++;
    }
    for(int i=0;i<8;i++){
      for(int j=0;j<5;j++){
        cout<<ans[j][i];
      }
      cout<<endl;
    }
  }
}
accuracy: 1
time_ms: 10
memory_kb: 1184
final_rank: 7

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

int main(){
  string s;
  bool flag=false;
  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[7][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[7][x]=0;
      }
    }
    if(flag)
      cout<< endl;
    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;
    }
    flag=true;
  }
}
accuracy: 1
time_ms: 10
memory_kb: 1176
final_rank: 4

code_snippet: #include <iostream>
#include <string>
using namespace std;
#define rep2(x,from,to) for(int x=(from);x<(to);++(x))
#define rep(x,to) rep2(x,0,to)
int main() {
	string n;
	bool p = 0;
	while(cin >> n) {
		if(p) cout << endl;
		p = 1;
		int k = n.length();
		string ans[8][5];
		rep(i,8) {
			rep(j,5) {
				if(i==2) ans[i][j] = '=';
				else if(i==1||i==3) ans[i][j] = ' ';
				else ans[i][j] = '*';
			}
		}
		rep(i,k) {
			int m = n[i]-'0';
			if(m>=5) swap(ans[0][i+5-k], ans[1][i+5-k]);
			rep(j,m%5) swap(ans[3+j][i+5-k],ans[4+j][i+5-k]);
		}
		rep(i,8) {
			rep(j,5) {
				cout << ans[i][j];
			}
			cout << endl;
		}
	}
	return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 1176
final_rank: 4

code_snippet: #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];
bool first=true;
while(cin>>str){

	if(first==false)cout<<endl;
	first=false;
int t=5-str.size();
bool f=true;

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

char y=str[i-t];


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

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

}
	
}
int w=8;
//	if(f==true)w=7;
for(int i=0;i<w;i++){
for(int j=0;j<5;j++)
cout<<ch[i][j];

cout<<endl;
}

}
return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 1180
final_rank: 6

code_snippet: #include<iostream>
#include<string>
using namespace std;

int main(){

	int n, len, cnt, set;
	char sb[7][5];
	string str;
	
	set = 0;	

	while(cin >> str){
		set++;
		if(set != 1) cout << endl;
		cnt = 0;
		len = str.length();
		for(int i=0; i<5; i++){
			if(len+i >= 5){
				n = str[cnt] - '0';
				cnt++;
			}
			else n = 0;
			if(n >= 5){
				sb[0][i] = ' ';
				sb[1][i] = '*';
			}
			else {
				sb[0][i] = '*';
				sb[1][i] = ' ';
			}
			for(int j=2; j<7; j++){
				sb[j][i] = '*';
			}
			sb[n%5+2][i] = ' ';
		}
		
		for(int i=0; i<7; i++){
			for(int j=0; j<5; j++){
				cout << sb[i][j];
			}
			cout << endl;
			if(i == 1) cout << "=====" << endl;
		}
	}

	return 0;

}
accuracy: 1
time_ms: 10
memory_kb: 1172
final_rank: 2