- 4 4 7 30 - 9
내 ¶
1 목
* ** *** **** *** ** *
- 를 .
¶
#include <stdio.h> #include <conio.h> int main(void) { int a,b,c; int d,e,f ; a=1, c=1, d=0; scanf("%d", &b); e=b, f=1; while (a<b) { c=1, d=0; printf("\n"); while (d<f) { printf("*"); c++, d++; } f++, a++; } a=0, c=1, d=0; while (a<e) { c=1, d=0; printf("\n"); while (d<b) { printf("*"); c++, d++; } a++, b--; } _getch(); return 0; }
민 ¶
#include <stdio.h> #include<stdio.h> int main() { int a, b, c; scanf("%d",&c); for(a=1;a<2*c;a++){ if(a<=c){ for(b=1;b<=a;b++) printf("*"); printf("\n"); } else { for(b=2*c-a;b>=1;b--) printf("*"); printf("\n"); } } return 0; }
¶
만들
봉 듣 대 못 만들 보 는 만들를 보 더
. 는 보는 . ㅎㅎㅎㅎ (민)
. 는 보는 . ㅎㅎㅎㅎ (민)
2
2 만, 1 ... . 부 .
while문 머리를 , . for문 는 대 배.
는 먹 를 .(마 문 런봐. .)
부는 들 바바 ~. ()
2 만, 1 ... . 부 .
while문 머리를 , . for문 는 대 배.
는 먹 를 .(마 문 런봐. .)
부는 들 바바 ~. ()
¶
- 2 목
3 (<- scanf ) * *** *****
- Hint!
- 백 는 복문 * 는 복문 2를 만.
- 백 는 * 는 내 만들 를 .
- 백 는 복문 * 는 복문 2를 만.
¶
#include <stdio.h> int main(void) { int n, a, b, c; a=1, b=0, c=0; scanf("%d", &n); while (a<=n) { printf("\n"); while(c<n) { printf(" "); c++;} b=0; while(b<2*a-1){ printf("*"); b++;} c=a; a++; } getch(); return 0; }
민 ¶
#include <stdio.h> #include<stdio.h> int main(){ int a, b, n; scanf("%d",&n); for(a=1;a<=n;a++){ for(b=n;b>a;b--) printf(" "); for(b=1;b<=2*a-1;b++) printf("*"); printf("\n"); } return 0; }
- 3 목
3 (<- scanf ) * *** ***** *** *
¶
#include <stdio.h> int main(void) { int n, a, b, c, d; a=1, b=0, c=0; scanf("%d", &n); while (a<=n-1) { printf("\n"); while(c<n) { printf(" "); c++; } b=0; while(b<2*a-1){ printf("*"); b++; } c=a, a++; } a=1, b=0, c=0; d=n; while (a<=n) { printf("\n"); while(c<a) { printf(" "); c++; } while(b<2*d-1){ printf("*"); b++; } c=0, d--, a++, b=0; } getch(); return 0; }
민 ¶
#include<stdio.h> int main(){ int a, b, n; scanf("%d",&n); for(a=1;a<=2*n-1;a++){ if(a<=n){ for(b=n;b>a;b--) printf(" "); for(b=1;b<=2*a-1;b++) printf("*"); printf("\n"); } else{ for(b=1;b<=a-n;b++) printf(" "); for(b=1;b<=4*n-2*a-1;b++) printf("*"); printf("\n"); } } return 0; }