Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Matriz em .C */
- #include <stdio.h>
- #include <time.h>
- #include <stdbool.h>
- #define line 3 /*Quantidade de linhas */
- #define colune 3/* quantidade de colunas */
- bool List()
- {
- int y,i,vetor[line][colune],j;
- for(i=0; i <3; i++)
- for(y=0; y <=3; y++){
- printf("\nDIGITE \n");
- printf("> "); scanf("%d",&vetor[i][y]);
- }
- for(i=0; i <3; i++)
- for(j=0; j <=3; j++){
- switch(vetor[i][j]){
- case 0:
- a++;
- break;
- case 1:
- b++;
- break;
- case 2:
- c++;
- break;
- }
- }
- return true;
- }
- int main()
- {
- List();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement