Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
520 B
48
Indexable
Never
#include<stdio.h>
int luythua(int a,int b){
	int tich=1;
	for(int i=1;i<=b;++i){
		tich*=a;
	}
	return tich;
}
int check(int n){
	int a,b=10;
	while(n!=0){
		a=n%10;
		if(a>b) return 0;
		n/=10;
		b=a;	
	}
	return 1;
}
int main(){	
	int test;scanf("%d",&test);
		for(int i=1;i<=test;++i){
			int n;scanf("%d",&n);
			if(n>1 && n<7){
				for(int i=luythua(10,n-1); i<=luythua(10,n)-1;++i) {
					if(check(i)==1) printf("%d ",i);
				}
			}
			else break;
			printf("\n");
		}
	return 0;
}