#include<stdio.h>
int main( ) {
int i,n,q,p;
scanf("%d",&i);
while(i--) {
scanf("%d",&n);
for(q=1;q<n;q+=2)
printf("%d ",q);
printf("\n");
for(p=2;p<=n;p+=2)
printf("%d ",p);
printf("\n");
}
}
时间: 2024-10-10 21:03:20
#include<stdio.h>
int main( ) {
int i,n,q,p;
scanf("%d",&i);
while(i--) {
scanf("%d",&n);
for(q=1;q<n;q+=2)
printf("%d ",q);
printf("\n");
for(p=2;p<=n;p+=2)
printf("%d ",p);
printf("\n");
}
}