合肥工业大学oj 1252 面试

//使用%在读入的时候实现移位
#include<iostream>
using namespace std;

int t, n, k;

int main(){
    cin >> t;
    while(t--){
        cin >> n >> k;
        int list[n];
        for(int i = k; i < n + k; i++){
            cin >> list[i % n];
        }
        for(int i = 0; i < n; i++){
            cout << list[i] << (i != n - 1 ? " " : "\n"); 
        }
    }
    return 0;
} 

//presented by 大吉大利,今晚AC

猜你喜欢

转载自blog.csdn.net/lalala_HFUT/article/details/87967445