Programming/C/C++ [C언어] 다이아몬드 출력하는 C 코드 MNLT 2008. 10. 23. 00:33 소스보기접기 #include <stdio.h> #include <conio.h> #include <iostream.h> void main() { int x, y, z = 0; for(x = -3; x <= 3; x++) { for(y = -3; y <= 3; y++) { if(z >= abs(y)) { printf("★"); } else { printf("☆"); } } printf("\n"); if(x < 0) { ++z; } else { --z; } } getch(); } 접기