0
Basically I have this program
int main(){
coordenada lista1_coordenadas[3];
coordenada lista2_coordenadas[3];
for (int i=0;i<3;i++){
printf("Leia a coordenada %d da primeira lista:\n", i+1);
printf("x: ");
scanf("%d\n", &lista1_coordenadas[i].x);
printf("y: ");
scanf("%d\n", &lista1_coordenadas[i].y);
}
for (int i=0;i<3;i++){
printf("Leia a coordenada %d da segunda lista:\n", i+1);
printf("x: ");
scanf("%d\n", &lista2_coordenadas[i].x);
printf("y: ");
scanf("%d\n", &lista2_coordenadas[i].y);
}
return 0;
But when I scan the x of the first coordinate of the list 1, it ignores the first scan and asks to input the value again, and I don’t know how to fix it.
Here’s the struct I used
typedef struct coordenada{
int x, y;
}coordenada;