| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
谁能帮忙看看错在哪里啊!好郁闷!3Q!!!#include < iostream >
#include < string >
using namespace std;
int main()
{
char a[200][200], b[200][200], c[201], lenth, col, m;
int n;
cin>>n;
while (n!=0)
{
m=n-1;
cin>>c;
lenth=strlen(c);
col=lenth/n;
for(int i=0;i<col;i++)
{
for(int j=0;j<n;j++)
{
a[i][j]=c[i*n+j];
}
}
for(i=0;i<col;i++)
{
for(int j=0;j<n;j++)
{
if((i+1)%2 == 0)
{
b[i][j]=a[i][m];
m--;
}
else b[i][j]=a[i][j];
}
m=n-1;
}
for(i=0;i<n;i++)
{
for(int j=0;j<col;j++)
{
cout<<b[j][i];
}
}
cout<<endl;
cin>>n;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator