diogoAlves

IFF/Introdução à Programação/Lista/80

Mar 8th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.77 KB | None | 0 0
  1. //IFF - Introdução à Programação
  2. //Lista - Exercício 80
  3. #include<stdio.h>
  4. #include<locale.h>
  5.  
  6. int main(){
  7.     setlocale(LC_ALL,"Portuguese");
  8.     int vetorColuna1[7]={0}, vetorColuna2[7]={0}, matriz[7][2],check=0;
  9.     for(int i=0;i<7;i++){
  10.         if(check==0){
  11.             printf("Entre com o valor da posição %d do primeiro vetor: ",i+1);
  12.             scanf("%d",&vetorColuna1[i]);
  13.             matriz[i][0]=vetorColuna1[i];
  14.         }
  15.         if((check==0)&&(i==6)){
  16.             check=1;
  17.             i=0;
  18.         }
  19.         if(check==1){
  20.             printf("Entre com o valor da posição %d do segundo vetor: ",i+1);
  21.             scanf("%d",&vetorColuna2[i]);
  22.             matriz[i][1]=vetorColuna2[i];
  23.         }
  24.     }
  25.     printf("\n\nMatriz resultado:\n");
  26.     for(int l=0;l<7;l++){
  27.         for(int c=0;c<2;c++){
  28.             printf("%d ",matriz[l][c]);
  29.         }
  30.         printf("\n");
  31.     }
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment