Advertisement
Marcos_Carvalho

Questao3 da prova prática

May 11th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.70 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(){
  4.    
  5.     int t=3;
  6.     int vet[t][t],menor[t],jota[t];
  7.    
  8.     for(int i=0;i<t;i++){
  9.        
  10.         for(int j=0;j<t;j++){
  11.             scanf("%d",&vet[i][j]);
  12.        
  13.         }
  14.        
  15.     }
  16.    
  17.     for(int i=0;i<t;i++){
  18.         for(int j=0;j<t;j++){
  19.         printf("%d ",vet[i][j]);
  20.             if(j==0){
  21.                 menor[i]=vet[i][j];
  22.                 jota[i]=j;
  23.             }
  24.             if(menor[i]>vet[i][j]){
  25.                 menor[i]=vet[i][j];
  26.                 jota[i]=j;
  27.             }
  28.     }
  29.         printf("\n");
  30.     }
  31.     for(int i=0;i<t;i++){
  32.         printf("linha:%d %d\n",i+1,jota[i]+1);
  33.     }
  34.    
  35.    
  36.    
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement