#include<iostream>
#include<string>
using namespace std;
int main()
{
int n,i,j;
string a,x[50][50];
cin>>n;
while(n!=0)
{
int key=0;
cin>>a;
int c=(a.length())/n;
string::iterator it=a.begin();
for(i=0;i<c;i++)
{//改变同一行的读取方向
if(key==0)
key=1;
else
key=0;
if(key==0)
{
for(j=n-1;j>=0;j--)
{
x[i][j]=*it;
it++;
}
}
else
{
for(j=0;j<n;j++)
{
x[i][j]=*it;
it++;
}
}
}
for(j=0;j<n;j++)
{
for(i=0;i<c;i++)
cout<<x[i][j];
}
cout<<endl;
cin>>n;
}
system("pause");
return 0;
}
sicily-code--2.rar_sicily
版权申诉
11 浏览量
2022-09-19
20:42:38
上传
评论
收藏 2KB RAR 举报
局外狗
- 粉丝: 64
- 资源: 1万+