*
**
***
****
*****
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
int main()
{
int size = 0;
scanf("%d", &size);
for (int idx = 0; idx < size; idx++)
{
for (int jdx = 0; jdx < idx+1; jdx++)
{
printf("*");
}
printf(" \n");
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
*****
****
***
**
*
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#include <iostream>
int main()
{
int size = 0;
scanf("%d", &size);
for (int idx = 0; idx < size; idx++)
{
for (int jdx = size; jdx > idx; jdx--)
{
printf("*");
}
printf(" \n");
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
*
**
***
****
*****
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#include <iostream>
int main()
{
int size = 0;
scanf("%d", &size);
for (int idx = 0; idx < size; idx++)
{
for (int jdx = 0; jdx < size ; jdx++)
{
if (jdx < size - (idx+1))
{
printf(" ");
}
else
{
printf("*");
}
}
printf("\n");
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
*****
****
***
**
*
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include <iostream>
int main()
{
int size = 0;
scanf("%d", &size);
for (int idx = 0; idx < size; idx++)
{
for (int jdx = 1; jdx <= idx; jdx++)
{
printf(" ");
}
for (int kdx = 1; kdx <= size - idx; kdx++)
{
printf("*");
}
printf("\n");
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
*
**
***
****
*****
*****
****
***
**
*
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#include <iostream>
int main()
{
int size = 0;
scanf("%d", &size);
for (int idx = 0; idx < size; idx++)
{
for (int jdx = size; jdx > idx ; jdx--)
{
if (jdx < size - (idx))
{
printf(" ");
}
else
{
printf("*");
}
}
printf("\n");
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
'프로그래밍 > 알고리즘' 카테고리의 다른 글
백준 1110 더하기 사이클 (0) | 2019.08.26 |
---|---|
백준 10951 (0) | 2019.08.26 |
백준 10817 세수 (0) | 2019.08.21 |
버블소팅 (0) | 2019.08.21 |
백준 2884 알람 시계 (0) | 2019.08.20 |