Codeforces 1462 A. Favorite Sequence
生活随笔
收集整理的這篇文章主要介紹了
Codeforces 1462 A. Favorite Sequence
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Codeforces 1462 A. Favorite Sequence
思路分析:
看著題怪長,其實就是類似與回文字符串,搞一個雙指針就好了
AC代碼:
#include <iostream>using namespace std;const int N = 310;int a[N];int main() {int t;cin >> t;while (t--) {int n;cin >> n;for(int i=0;i<n;i++)cin >> a[i];for(int i = 0,j = n-1;i<=j;i++,j--) {if( i != j)cout << a[i] << ' ' << a[j] << ' ';elsecout << a[i];}cout << endl;}return 0; }總結
以上是生活随笔為你收集整理的Codeforces 1462 A. Favorite Sequence的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何在 Windows 11 家庭版和专
- 下一篇: 闪聚支付-第1章-Nacos-服务发现与