Advertisement
luciana1237

Untitled

Aug 10th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.93 KB | None | 0 0
  1. /*Matriz em .C */
  2.  
  3. #include <stdio.h>
  4. #include <time.h>
  5. #include <stdbool.h>
  6.  
  7. #define line 3 /*Quantidade de linhas */
  8. #define colune 3/* quantidade de colunas */
  9.  
  10. bool List()
  11. {
  12.     int y,i,vetor[line][colune],j;
  13.     for(i=0; i <3; i++)
  14.         for(y=0; y <=3; y++){
  15.             printf("\nDIGITE \n");
  16.             printf("> "); scanf("%d",&vetor[i][y]);
  17.            
  18.         }
  19.         for(i=0; i <3; i++)
  20.                 for(j=0; j <=3; j++){
  21.                         switch(vetor[i][j]){
  22.                             case 0:
  23.                                 a++;
  24.                                 break;
  25.                             case 1:
  26.                                 b++;
  27.                                 break;
  28.                             case 2:
  29.                                 c++;
  30.                                 break;
  31.                         }
  32.                 }
  33.      return true;
  34. }
  35.  
  36.  
  37. int main()
  38. {
  39.     List();
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement