nikolas_serafini

Lista 3 - Exercício 41

Jun 15th, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int i,j,lines,k = 0;
  6.  
  7.     printf("Entre com a quantidade de linhas :\n");
  8.     scanf("%d",&lines);
  9.  
  10.     for (i = 1; i <= lines; i++)
  11.     {
  12.         for (j = 1; j <= lines-i; j++)
  13.         {
  14.             printf("  ");
  15.         }
  16.         while(k != 2*i - 1)
  17.         {
  18.             printf("* ");
  19.             k++;
  20.         }
  21.         k = 0;
  22.         printf("\n");
  23.     }
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment