Q
백준 2444

C code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| #include <stdio.h>
int main(void) { int n;
scanf("%d", &n);
if(n < 0 && n > 100) return 0; for(int i = 1; i <= n; i++) { for(int j = n - 1; j >= i; j--) printf(" "); for(int j = 0; j < i; j++) printf("*"); for(int j = 1; j < i; j++) printf("*"); printf("\n"); }
for(int i = n-1; i >= 0; i--) { for(int j = n; j > i; j--) printf(" "); for(int j = 0; j < i; j++) printf("*"); for(int j = 1; j < i; j++) printf("*");
printf("\n"); }
return 0; }
|
Author:
Slay
Permalink:
http://sean-baek.github.io/2023/05/07/baekjoon-2444/
License:
Copyright (c) 2021 CC-BY-NC-4.0 LICENSE
Slogan:
Do you believe in DESTINY?