- 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; }