Created
July 3, 2017 18:41
-
-
Save riemannulus/6a658153f80bfd4f8b4f8ff569e01ac0 to your computer and use it in GitHub Desktop.
Pointing a Star - 5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
/* | |
역삼각형 모양의 공백을 출력 후 2*n-1 개의 별을 출력하면 되는 문제 | |
*/ | |
using namespace std; | |
int main() | |
{ | |
int a, b = 0; | |
scanf("%d", &a); | |
while (a--) | |
{ | |
b++; | |
for (int i = 0; i < a; i++) | |
{ | |
printf(" "); | |
} | |
for (int i = 0; i < (2 * b) - 1; i++) printf("%c",'*'); | |
printf("\n"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment