洛谷P1538迎春舞會之數字舞蹈
阿新 • • 發佈:2018-11-05
題目: https://www.luogu.org/problemnew/show/P1538
輸出:
坑。。。。。。。。。
#include<iostream> #include<cstring> using namespace std; int main() { int k; char a[260]; int b; cin>>k; cin>>a; b=strlen(a); for(int j=0;j<b;j++) { int p=a[j]-'0'; switch(p) { case 1: { cout<<" "; for(int i=0;i<k;i++) cout<<" "; cout<<" ";break; } case 2: { cout<<" "; for(int i=0;i<k;i++) cout<<"-"; cout<<" ";break; } case 3: { cout<<" "; for(int i=0;i<k;i++) cout<<"-"; cout<<" ";break; } case 4: { cout<<" "; for(int i=0;i<k;i++) cout<<" "; cout<<" ";break; } case 5: case 6: { cout<<" "; for(int i=0;i<k;i++) cout<<"-"; cout<<" ";break; } case 7: { cout<<" "; for(int i=0;i<k;i++) cout<<"-"; cout<<" ";break; } case 8: case 9: case 0: { cout<<" "; for(int i=0;i<k;i++) cout<<"-"; cout<<" ";break; } } } cout<<endl; for(int m=0;m<k;m++) { for(int j=0;j<b;j++) { int p=a[j]-'0'; switch(p) { case 1: { cout<<" "; for(int i=0;i<k;i++) cout<<" "; cout<<"| ";break; } case 2: { cout<<" "; for(int i=0;i<k;i++) cout<<" "; cout<<"| ";break; } case 3: { cout<<" "; for(int i=0;i<k;i++) cout<<" "; cout<<"| ";break; } case 7: { cout<<" "; for(int i=0;i<k;i++) cout<<" "; cout<<"| ";break; } case 4: case 8: case 9: case 0: { cout<<"|"; for(int i=0;i<k;i++) cout<<" "; cout<<"| ";break; } case 5: case 6: { cout<<"|"; for(int i=0;i<k;i++) cout<<" "; cout<<" ";break; } } } cout<<endl; } for(int j=0;j<b;j++) { int p=a[j]-'0'; switch(p) { case 1: { cout<<" "; for(int i=0;i<k;i++) cout<<" "; cout<<" ";break; } case 3: { cout<<" "; for(int i=0;i<k;i++) cout<<"-"; cout<<" ";break; } case 7: { cout<<" "; for(int i=0;i<k;i++) cout<<" "; cout<<" ";break; } case 2: case 4: case 5: case 6: case 8: case 9: { cout<<" "; for(int i=0;i<k;i++) cout<<"-"; cout<<" ";break; } case 0: { cout<<" "; for(int i=0;i<k;i++) cout<<" "; cout<<" "; } } } cout<<endl; for(int m=0;m<k;m++) { for(int j=0;j<b;j++) { int p=a[j]-'0'; switch(p) { case 1: { cout<<" "; for(int i=0;i<k;i++) cout<<" "; cout<<"| ";break; } case 2: { cout<<"|"; for(int i=0;i<k;i++) cout<<" "; cout<<" ";break; } case 3: { cout<<" "; for(int i=0;i<k;i++) cout<<" "; cout<<"| ";break; } case 4: case 5: case 9: { cout<<" "; for(int i=0;i<k;i++) cout<<" "; cout<<"| ";break; } case 6: case 8: case 0: { cout<<"|"; for(int i=0;i<k;i++) cout<<" "; cout<<"| ";break; } case 7: { cout<<" "; for(int i=0;i<k;i++) cout<<" "; cout<<"| ";break; } } } cout<<endl; } for(int j=0;j<b;j++) { int p=a[j]-'0'; switch(p){ case 1: { cout<<" "; for(int i=0;i<k;i++) cout<<" "; cout<<" ";break; } case 2: { cout<<" "; for(int i=0;i<k;i++) cout<<"-"; cout<<" ";break; } case 3: { cout<<" "; for(int i=0;i<k;i++) cout<<"-"; cout<<" ";break; } case 4: { cout<<" "; for(int i=0;i<k;i++) cout<<" "; cout<<" ";break; } case 5: case 6: { cout<<" "; for(int i=0;i<k;i++) cout<<"-"; cout<<" ";break; } case 7: { cout<<" "; for(int i=0;i<k;i++) cout<<" "; cout<<" ";break; } case 8: case 9: case 0: { cout<<" "; for(int i=0;i<k;i++) cout<<"-"; cout<<" ";break; } } } return 0; }