[정올] Language Coder_반복제어문3_자가진단3_code550 (C)
두비니
·2020. 4. 3. 16:56
C언어
#include <stdio.h>
int main() {
int n;
scanf("%d", &n);
for (int i = n; i > 0; i--) {
for (int j = 0; j < i; j++) {
printf("*");
}
printf("\n");
}
for (int i = 1; i<= n; i ++) {
for (int j = 0; j < i; j++) {
printf("*");
}
printf("\n");
}
return 0;
}
Python
n = int(input())
for i in range(n, 0, -1):
print("*"*i)
for i in range(1, n+1):
print("*"*i)
'Coding_Algorithm > 정올 문제풀이' 카테고리의 다른 글
[정올] Language Coder_반복제어문3_자가진단5_code552 (C) (0) | 2020.04.05 |
---|---|
[정올] Language Coder_반복제어문3_자가진단4_code551 (C) (0) | 2020.04.04 |
[정올] Language Coder_반복제어문3_자가진단2_code634 (C) (0) | 2020.04.02 |
[정올] Language Coder_반복제어문3_자가진단1_code549 (C) (0) | 2020.04.01 |
[정올] Language Coder_반복제어문2_형성평가A_code139 (C) (0) | 2020.03.31 |