Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

我晕 题目前面说用x来填充 还以为x不用输出 大一了 wa一次 也晒下代码

Posted by 785815369 at 2010-08-01 14:03:26 on Problem 2039 and last updated at 2010-08-01 14:04:20
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator