This is a problem of URI online judge.Problem no.1914 beginner.According to my code if i give input 4 then the the program should read strings 4 times and also integer 4 times each time two integer.but the program are only taking 4 times input either 4 times string or 4 times integer or 2 times string+ 2 times integer.
#include <stdio.h>
int main()
{
char name[1000][100],ch;
int a,b,c,i,j=0,k,n[1000][2];
scanf("%d",&a);
for(i=0;i<a;i++)
{
gets(name[i]);
for(k=0;k<2;k++)
{
scanf("%d",&n[i][k]);
}
}
}
if inputs are
4
Quico PAR Chiquinha IMPAR
9 7
Dami PAR Marcus IMPAR
12 3
Dayran PAR Conrado IMPAR
3 1000000000
Popis PAR Chaves IMPAR
2 7
After taking 4 lines of input the program end.If u can help help with that please help.
quico PAR chiquinha IMPER
9 7
dami PAR marcus IMPER
12 3