Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void matriz();
- int main(){
- matriz();
- return 0;
- }
- void matriz(){
- int i = 0, j = 0, coluna = 0, mat[100][100], x = 1;
- while (x != -2){
- while(x != -2){
- scanf("%d", &x);
- if(x > 0){
- mat[i][j] = x;
- j++;
- coluna++;
- }
- else if(x < 0){
- j = 0;
- i++;
- break;
- }
- }
- if(x == -2){
- break;
- }
- }
- printf("numero de colunas: %d\n", coluna);
- printf("numero de linhas: %d", i);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement