I want to enter the values in this format:
2
7 8 9
1 2 3
7 8
4
4 5 6
7 5 3
4 0 9
7 3 6
7 3
7 6
1 5
0
the first line is an integer 'n', following will be of 3 integers in each n lines, then 2 integers in each n-1 lines, if the next value is equal to ZERO then terminate else continue to accept the values in the same format.
Code:
#include<stdio.h>
main()
{ int a[100][10]={0},b[100][10]={0},i,j=-1,n,nxt;
do
{
i=-1;
j++;
scanf("%d",&n);
do{
i=i+1;
scanf("%d",&a[i][j]);
printf(" part1\n ");
}while(i<3*n-1);
i=-1;
do{
i=i+1;
scanf("%d",&b[i][j]);
printf(" part2\n ");
}while(i<n-1);
scanf("%d",&nxt);
}while(nxt!=0);
return 0;
}
please help