단일 루프로 나선형을 만들 수 있습니까? 전에는 나선을 만들었지 만 여러 루프에서만 만들었습니다. 출력을 표시 할 코드 보너스.for/while 또는 while 루프로 나선형으로 만들기
#include "conio.h"
#include "dos.h"
#include "stdlib.h"
void main()
{
int p,q,r,s,t;
clrscr();
for(p=8; p<14; p++)
{
for(q=5 ; q<26; q++)
{
gotoxy(5,q);
printf("Û");
}
for(r=5; r<50; r++)
{
printf("Ü");
}
for(s=25; s>4; s--)
{
gotoxy(50,s);
printf("Û");
}
for(t=50; t>6; t--)
{
gotoxy(t,4);
printf("Ü");
}
for(q=5; q<25; q++)
{
gotoxy(7,q);
printf("Û");
}
// etc. . . I didn't write the full code.
}
'void main()'- ew ... –