[정올] Language Coder_반복제어문2_형성평가A_code139 (C)

두비니

·

2020. 3. 31. 05:43

 

 

 

#include <stdio.h>

int main() {

	int a, b;

	scanf("%d %d", &a, &b);

	if (a < b) {
		for (int i = 1; i <= 9; i++) {
			for (int j = a; j <= b;) {
				printf("%d *%2d = %2d   ", j, i, j*i);
				if (a < b)
					j++;
			}
			printf("\n");
		}
	}
	else {
		for (int i = 1; i <= 9; i++) {
			for (int j = a; j >= b; j--) {
				printf("%d *%2d = %2d   ", j, i, j*i);
			}
			printf("\n");
		}
	}

	return 0;
}