这道题有一点坑
从第一个到第n-1个数,就是这个数的编号+1,最后的一个数就是1
这样就可以了
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int t;
cin >> t;
while (t --)
{
int n;
scanf("%d", &n);
for (int i = 1; i < n; i ++) printf("%d ", i + 1);
puts("1");
}
return 0;
}