算法训练 图形显示

http://lx.lanqiao.org/problem.page?gpid=T247

算法训练 图形显示  
时间限制:1.0s   内存限制:512.0MB
    
问题描述
  编写一个程序,首先输入一个整数,例如5,然后在屏幕上显示如下的图形(5表示行数):
  * * * * *
  * * * *
  * * *
  * *
  *
 
分析:
 
一个字,送分题。
 
AC代码:
 
 1 #include <stdio.h>
 2 int main()
 3 {
 4     int i , j , n;
 5     while(scanf("%d",&n)!=EOF)
 6     {
 7         for(i = 1 ;i <= n;i ++)
 8         {
 9             for(j = 1; i + j < n + 1; j ++)
10                 printf("* ");
11             puts("*");
12         }
13     }
14     return 0;
15 }
View Code
原文地址:https://www.cnblogs.com/jeff-wgc/p/4450380.html