【题意简述】:这个题意描述很简单,看输入输出就可以了。
【分析】:还是刷水题心情好点~
不过,不知为什么我的代码,G++过了,而C++却CE。
// 748K 16Ms #include<iostream> #include<cstdio> using namespace std; #include<cstring> string cha[26]; string cha1[26],cha2[26]; int main() { int n; int count = 1; while(cin>>n,n) { int count1 = 1; int count2 = 1; for(int i = 1;i<=n;i++) { cin>>cha[i]; if(i%2) cha1[count1++] = cha[i]; else cha2[count2++] = cha[i]; } cout<<"SET "<<count<<endl; for(int i = 1;i<count1;i++) cout<<cha1[i]<<endl; for(int i = count2-1;i>=1;i--) cout<<cha2[i]<<endl; count++; } return 0; }
时间: 2024-08-01 23:06:38