nikolas_serafini

Lista 3 - Exercício 40

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