浙大版《C语言程序设计(第3版)》题目集 练习2-3 输出倒三角图案 (5 分)

练习2-3 输出倒三角图案 (5 分)

本题要求编写程序,输出指定的由“*”组成的倒三角图案。

输入格式:

本题目没有输入。

输出格式:

按照下列格式输出由“*”组成的倒三角图案。

* * * *
 * * *
  * *
   *

思路:格式化输出,注意换行。

代码如下:
#include<stdio.h>
int main()
{
    printf("* * * *
"); 
    printf(" * * *
");
    printf("  * *
");
    printf("   *
");

	return 0;
}			

  

  

原文地址:https://www.cnblogs.com/IT-Lead-The-World/p/10345494.html