0
#include<stdio.h>
#include<stdlib.h>
#include<limits.h>
#include<locale.h>
int main(){
int i,j;
int mat[3][3];
int comp[2][2];
for(i=0;i<3;i++){
for(j=0;j<3;j++){
printf("Entre com o Valor [%d][%d]\n",i+1,j+1);
scanf("%d",&mat[i][j]);
}
}
for(i=0;i<3;i++){
if(i==0){
i++;
for(j=0;j<3;j++){
if(j==0){
j++;
comp[i-1][j-1]=mat[i][j];
}
else comp[i-1][j]=mat[i][j];
}
}
else{
for(j=0;j<3;j++){
if(j==0){
j++;
comp[i][j-1]=mat[i][j];
}
else comp[i][j]=mat[i][j];
}
}
}
printf("\n");
printf("Matriz 3 X 3\n\n");
for(i=0;i<3;i++){
for(j=0;j<3;j++){
printf("%d ",mat[i][j]);
if(j==2) printf("\n");
}
}
printf("\n");
printf("Matriz 2 X 2\n\n");
for(i=0;i<2;i++){
for(j=0;j<2;j++){
printf("%d ",comp[i][j]);
if(j==1) printf("\n");
}
}
return 0;
}
Cool the code... But, what is your doubt or your difficulty? What is it that you want to ask?
– Victor Stafusa
I need to make a code that receives a square matrix tam N and copies the data in another complementary tam /n-1. I made a basic case to remove row 0 and column 0, but actually the row and column to be omitted could be anyone to be passed as argument.
– Ramilson Silva