Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
401 B
3
Indexable
Never
#include <stdio.h>

int main(){
	int A[9][9],m,n;
	scanf("%d%d",&m,&n);
	int max = m;
	if( m < n){
		max = n;
	}
	for( int i = 0; i < max; i++){
		for( int j = 0; j < max - i; j++){
			A[i][j] = max-i-j;
		}
		int s = 2;
		for( int j = max - i; j <= max - 1; j++){

			A[i][j] = s++;
		}
	}
	for( int i = 0; i < m; i++){
		for( int j = 0; j < n; j++){
			printf("%d",A[i][j]);
		}
		printf("\n");
	}
}