for문 중첩 초보라 힘드네요 ㅠㅠ도와주세요
월향
2023.04.01
*
***
*****
*******
*********int a,b;
for(a=1; a10; a++)
{
if(a=5)
{
for(b=1; b10; b+=2)
{
printf(*);
}
}
printf(\n);
}
홀수개의 별표로 이뤄진 모양을 만들고 싶은데요
뭐가 오류인지 모르겟네요 ㅠㅠ
도와주세요ㅠㅠ
-
나로
#include stdio.h
void main()
{
\tint a,b;
\tfor(a=1; a10; a++)
\t{
\t\tif(a%2==1)
\t\t{
\t\t\tfor(b=1; b=a; b++)
\t\t\t{
\t\t\t\tprintf(\*\);
\t\t\t}
\t\t}
\t\tprintf(\\\n\);
\t}
}