考场上想了一会儿……
思路
可以横着打印。
数字可以用字符串输入。
代码
#include <bits/stdc++.h>
using namespace std;
int main(){string s;cin>>s;for(int i=0;s[i];i++){if(s[i]=='0'){cout<<".....";}else if(s[i]=='1'){cout<<"****.";}else if(s[i]=='2'){cout<<".....";}else if(s[i]=='3'){cout<<".....";}}cout<<endl;for(int i=0;s[i];i++){if(s[i]=='0'){cout<<".***.";}else if(s[i]=='1'){cout<<"****.";}else if(s[i]=='2'){cout<<"****.";}else if(s[i]=='3'){cout<<"****.";}}cout<<endl;for(int i=0;s[i];i++){if(s[i]=='0'){cout<<".***.";}else if(s[i]=='1'){cout<<"****.";}else if(s[i]=='2'){cout<<".....";}else if(s[i]=='3'){cout<<".....";}}cout<<endl;for(int i=0;s[i];i++){if(s[i]=='0'){cout<<".***.";}else if(s[i]=='1'){cout<<"****.";}else if(s[i]=='2'){cout<<".****";}else if(s[i]=='3'){cout<<"****.";}}cout<<endl;for(int i=0;s[i];i++){if(s[i]=='0'){cout<<".....";}else if(s[i]=='1'){cout<<"****.";}else if(s[i]=='2'){cout<<".....";}else if(s[i]=='3'){cout<<".....";}}return 0;
}