标签:nyoj
2 A 7 B 8
AA AA AA AA AA AA AA AA AA AA AA <---华丽的分割线---> BBB BB BB BB BB BBB BB BB BB BB BB BB BBB
上传者
#include<iostream> #include<stdio.h> #include<algorithm> #include<string.h> using namespace std; char c; int n; int main() { int t; cin>>t; for(int i=0;i<t;i++) { cin>>c>>n; //cout<<c<<endl; int a=n/6+1; int b=(n-3)/2; if((n-3)%2!=0) b++; //cout<<a<<" "<<b<<endl; int j,k; for(j=1;j<=n;j++) { if(j==1||j==n||j==n-b-1) { for(k=1;k<=a+b;k++) { if(k<=a) cout<<" "; else cout<<c; } } else { for(k=1;k<=2*a+b;k++) { if(k>a&&k<=a+b) cout<<" "; else cout<<c; } } cout<<endl; } if(i!=t-1) cout<<"<---华丽的分割线--->"<<endl; } }
标签:nyoj
原文地址:http://blog.csdn.net/u012349696/article/details/41828695