题目链接
好毒瘤的题……学习了大佬题解
这种毒瘤题老是做不来
#include<cstdio>
#include<iostream>
using namespace std;
string str[10]={"-|| ||-"," | | ","- |-| -","- |- |-"," ||- | ","-| - |-","-| -||-","- | | ","-||-||-","-||- |-"},s;
int k;
int main()
{
//freopen("in.txt","r",stdin);
cin>>k>>s;
for(int i=0;i<7;i++)
{
if(i==2||i==5)
continue;
if(i==0||i==3||i==6)//打印横线
{
for(int j=0;j<s.size();j++)
{
cout<<" ";
for(int t=0;t<k;t++)
cout<<str[s[j]-48][i];
cout<<" ";
}
cout<<endl;
}
else//打印竖线
{
for(int j=0;j<k;j++)
{
for(int t=0;t<s.size();t++)
{
cout<<str[s[t]-48][i];
for(int l=0;l<k;l++)
cout<<" ";
cout<<str[s[t]-48][i+1]<<" ";
}
cout<<endl;
}
}
}
return 0;
}