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

我的是10秒,这东西就是按照1,3,5,7,6,4,2的顺序嘛,太简单了···先奇数递增输出,在偶数递减输出

Posted by songzhenqi at 2010-10-17 19:53:10 on Problem 2013
In Reply To:这么多0ms, 怎么搞出来的? Posted by:hongtaos at 2007-12-02 21:50:20
#include <iostream>
#include <string> 
using namespace std;

int main()
{   //freopen("in.txt","r",stdin);
	int n;
	int zushu=1;
    while(cin>>n&&n!=0)
	{   
		char s[20][30];
		int i,j,k;
		for(i=1;i<=n;i++)
		{
			cin>>s[i];
		}
		cout<<"SET "<<zushu<<endl;
		for(k=1;k<=n;k+=2)
			cout<<s[k]<<endl;
		for(j=(n/2)*2;j>=2;j-=2)
			cout<<s[j]<<endl;
		zushu++;
	}
	return 0;
}

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