IvoSilva

[PROG1] Ficha 8 | Exercício 4

Dec 5th, 2011
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2. int main ()
  3. {
  4.     int n , i , j , v[100] ;
  5.     for (n = 0 ; v[n - 1] != -1 ; n++)
  6.     {
  7.         printf ("Introduza número: ") ;
  8.         scanf ("%d" , &v[n]) ;
  9.     }
  10.     for (i = 0 ; i < n - 1 ; i++)
  11.     {
  12.         printf ("%d - " , i + 1) ;
  13.         for (j = 0 ; j < v[i] ; j++) printf ("*") ;
  14.         printf ("\n") ;
  15.     }
  16.     return 0 ;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment