大水题,暴力输出,代码应该能看吧......
#include<iostream> #include<cstdio> using namespace std; int main() { ios::sync_with_stdio(false); int k=0,len=0; string s=""; cin>>k>>s; len=s.size(); for(int i=0;i<len;i++) { cout<<" "; if(i!=0) cout<<" "; if(s[i]=='1'||s[i]=='4') for(int j=1;j<=k;j++) cout<<" "; else for(int j=1;j<=k;j++) cout<<"-"; cout<<" "; } cout<<endl; for(int T=1;T<=k;T++) { for(int i=0;i<len;i++) { if(i!=0) cout<<" "; if(s[i]=='1'||s[i]=='2'||s[i]=='3'||s[i]=='7') cout<<" "; else cout<<"|"; for(int j=1;j<=k;j++) cout<<" "; if(s[i]=='5'||s[i]=='6') cout<<" "; else cout<<"|"; } cout<<endl; } for(int i=0;i<len;i++) { cout<<" "; if(i!=0) cout<<" "; if(s[i]=='0'||s[i]=='1'||s[i]=='7') for(int j=1;j<=k;j++) cout<<" "; else for(int j=1;j<=k;j++) cout<<"-"; cout<<" "; } cout<<endl; for(int T=1;T<=k;T++) { for(int i=0;i<len;i++) { if(i!=0) cout<<" "; if(s[i]=='0'||s[i]=='2'||s[i]=='6'||s[i]=='8') cout<<"|"; else cout<<" "; for(int j=1;j<=k;j++) cout<<" "; if(s[i]=='2') cout<<" "; else cout<<"|"; } cout<<endl; } for(int i=0;i<len;i++) { cout<<" "; if(i!=0) cout<<" "; if(s[i]=='1'||s[i]=='4'||s[i]=='7') for(int j=1;j<=k;j++) cout<<" "; else for(int j=1;j<=k;j++) cout<<"-"; cout<<" "; } return 0; }