飞机图形,大神帮忙给出最佳答案
[附件]我自己用了100多行代码才写出来。。。。如果用printf函数输出我感觉有点太。。。。。求大神给出完美答案#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int a, b,c,d,e,f;
for (a = 0; a < 1; a++)
{
for (b = 0; b < 32; b++)
{
if (b == 11)
{
printf("*");
printf("\n");
}
if (b == 22 || b == 25)
{
printf("*");
}
else
{
printf(" ");
}
}
}
printf("\n");
for (c = 0; c < 1; c++)
{
for (d = 0; d < 21; d++)
{
if (d == 1 || d == 9 || d == 13 || d == 15)
{
printf("*");
}
else
{
printf(" ");
}
}
}
printf("\n");
for (e = 0; e < 1;e++)
{
for (f = 0; f < 21;f++)
{
if (f == 1 || f == 2 || f == 8 || f == 12 || f == 14 || f == 16)
{
printf("*");
}
else
{
printf(" ");
}
}
}
printf("\n");
printf(" ***** * * * * * * *");
printf("\n");
for (e = 0; e < 1;e++)
{
for (f = 0; f < 21;f++)
{
if (f == 1 || f == 2 || f == 8 || f == 12 || f == 14 || f == 16)
{
printf("*");
}
else
{
printf(" ");
}
}
}
printf("\n");
for (c = 0; c < 1; c++)
{
for (d = 0; d < 21; d++)
{
if (d == 1 || d == 9 || d == 13 || d == 15)
{
printf("*");
}
else
{
printf(" ");
}
}
}
printf("\n");
for (a = 0; a < 1; a++)
{
for (b = 0; b < 32; b++)
{
if (b == 11 || b == 14)
{
printf("*");
}
else
{
printf(" ");
}
}
}
printf("\n");
for (a = 0; a < 1; a++)
{
for (b = 0; b < 32; b++)
{
if (b == 11)
{
printf("*");
}
else
{
printf(" ");
}
}
}
system("color 27");
system("pause");
return 0;
}
不好意思不知道怎么传图片。这是我自己写的代码,刚学C语言,同学都是用printf打的。我感觉这图形没什么规律。想问下有什么好的方法更简单点吗??谢谢
[此贴子已经被作者于2016-5-23 13:17编辑过]