| ||||||||||
| 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 | |||||||||
我晕 题目前面说用x来填充 还以为x不用输出 大一了 wa一次 也晒下代码#include<iostream>
using namespace std;
#include<cstring>
int main()
{
char str[303];
int n;
while(scanf("%d",&n),n!=0)
{
cin>>str;
int len=strlen(str);
int m=len/n;
for(int i=0;i<n;i++)
for(int j=0;j<m;j++)
{
int k;
if(j%2==1)k=n-i-1+n*j;
else k=i+n*j;
cout<<str[k];
}
cout<<endl;
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator