题解 | #带空格直角三角形图案#

带空格直角三角形图案

https://www.nowcoder.com/practice/192d1039c3d44155bb868073f5482670

#include <stdio.h>



int main() {
    int a, b, i, c;
    
    while(scanf("%d", &a)==1)
    {
            for (i = 0; i < a; i++)
    {
        for (c = a - i-1; c > 0; c--)
            printf("  ");
        for (b = 0; b <= i; b++)
        {
            printf("* ");
        }
        printf("\n");
    }
    }
    return 0;
}

全部评论

相关推荐

码农索隆:竞争压力小,就你一个不用卷
点赞 评论 收藏
分享
人间雪:简历最好只要一页,除非你牛逼到一页都写不下了
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-23 14:10
码农索隆:成年人最直白的答复:已读不回
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务