[정올] Beginner_Coder_도형만들기1_구구단2_code1341 (C)
두비니
·2021. 2. 2. 18:42
#include <stdio.h>
int main() {
int s, e, flag, i;
while (1) {
scanf("%d %d", &s, &e);
if (s >= 2 && e >= 2 && s <= 9 && e <= 9)
break;
else {
printf("INPUT ERROR!");
}
}
if (s > e)
flag = -1;
else
flag = 1;
for (i = s; i != e; i += flag) {
for (int j = 1; j <= 9 ; j++){
printf("%d * %d = %2d ", i, j, i*j);
if (j % 3 == 0)
printf("\n");
}
printf("\n");
}
for (int j = 1; j <= 9; j++) {
printf("%d * %d = %2d ", i, j, i*j);
if (j % 3 == 0)
printf("\n");
}
printf("\n");
return 0;
}
'Coding_Algorithm > 정올 문제풀이' 카테고리의 다른 글
[정올] Language Coder_반복제어문3_형성평가3_code142 (Python) (0) | 2021.02.19 |
---|---|
[정올] Language Coder_반복제어문1_자가진단1_code123 (Python) (0) | 2021.02.02 |
[정올] Language Coder_선택제어문_형성평가5_code124 (Python) (0) | 2021.02.02 |
[정올] Language Coder_선택제어문_형성평가4_code123 (Python) (0) | 2021.02.02 |
[정올] Language Coder_선택제어문_자가진단7_code534 (Python) (0) | 2021.02.02 |