| ||||||||||
| 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 | |||||||||
我的是10秒,这东西就是按照1,3,5,7,6,4,2的顺序嘛,太简单了···先奇数递增输出,在偶数递减输出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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator