标题:飞机图形,大神帮忙给出最佳答案
只看楼主
网络小白
Rank: 2
等 级:论坛游民
帖 子:26
专家分:35
注 册:2014-9-13
结帖率:77.78%
已结贴  问题点数:20 回复次数:5 
飞机图形,大神帮忙给出最佳答案
[附件]我自己用了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编辑过]

搜索更多相关主题的帖子: include 
2016-05-22 20:48
wp231957
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:神界
等 级:版主
威 望:422
帖 子:13681
专家分:53296
注 册:2012-10-18
得分:4 
无图无真相

DO IT YOURSELF !
2016-05-23 08:28
yuantkong
Rank: 2
等 级:论坛游民
威 望:3
帖 子:82
专家分:86
注 册:2016-5-17
得分:4 
看有没有规律, 做个循环
2016-05-23 09:53
zhulei1978
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:53
帖 子:1351
专家分:1200
注 册:2006-12-17
得分:4 
过程不重要,结果才重要

其实我就是改变社会风气,提高少女素质,刺激电影市道,提高年轻人内涵,玉树临风,风度翩翩的整蛊专家,我名叫古晶,英文名叫JingKoo!
2016-05-23 10:19
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:432
帖 子:10064
专家分:41463
注 册:2014-5-20
得分:4 
数据结构 + for + printf
2016-05-23 10:29
wp231957
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:神界
等 级:版主
威 望:422
帖 子:13681
专家分:53296
注 册:2012-10-18
得分:0 
没啥规律

DO IT YOURSELF !
2016-05-24 09:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-465138-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.116229 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved