#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std;
void test1() { //1 2 3 4 5 6 7 int num[][7]= {1,1,1,0,1,1,1 ,0,0,1,0,0,1,0 ,1,0,1,1,1,0,1 ,1,0,1,1,0,1,1 ,0,1,1,1,0,1,0 ,1,1,0,1,0,1,1 ,1,1,0,1,1,1,1 ,1,0,1,0,0,1,0 ,1,1,1,1,1,1,1 ,1,1,1,1,0,1,1 }; int len; string str; while (cin>>len>>str && len!=0 && str!="0") { //构建表 vector<vector<char> > table(2*len+3,vector<char>((len+2)*str.length()+str.length(),' ')); int i,j; for (i=0;i<str.length();i++) { //按行输出 int th=-3,tv=-2; for (j=0;j<(2*len+3);j++) { if(j%(len+1)==0) { th+=3; if(num[str[i]-'0'][th]) { for(int z=0;z<len;z++) table[j][i*(len+3)+2+z]='-'; } } else { if (j<len+1) { if(num[str[i]-'0'][1]) table[j][i*(len+3)+1]='!'; if(num[str[i]-'0'][2]) table[j][i*(len+3)+(len+2)]='!'; } else { if(num[str[i]-'0'][4]) table[j][i*(len+3)+1]='!'; if(num[str[i]-'0'][5]) table[j][i*(len+3)+(len+2)]='!'; } } } }
//输出 for (i=0;i<table.size();i++) { copy(table[i].begin()+1,table[i].end(),ostream_iterator<char>(cout,"")); cout<<endl; } }
}
void main() { test1(); }
//输入每段的长度 及要显示的数字
|