解法一:
#include<stdio.h>
int main()
{
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 5; j++)
{
printf(" ");
}
for (int k = 0; k < 2; k++)
{
printf("*");
}
printf("\n");
}
//飞机身
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 12; j++)
{
printf("*");
}
printf("\n");
}
//飞机尾
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 4; j++)
{
printf(" ");
}
for (int k = 0; k < 2; k ++)
{
printf("* ");
}
printf("\n");
}
return 0;
}
解法二:
#include<stdio.h>
int main()
{
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 5; j++)
{
printf(" ");
}
printf("**\n");
}
printf("************\n");
printf("************\n");
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 4; j++)
{
printf(" ");
}
printf("* *\n");
}
return 0;
}