#include <stdio.h>
#include<stdlib.h>
#include <string.h>
int main(void) {
char a[1001];
int t,i;
scanf("%d",&t);
while(t--)
{
fflush(stdin);
gets(a);
printf("%d\t",t);
puts(a);
}
return 0;
}
Input:
2
die another day.
i'm batman.
Ouput:
1
0 die another day.
Expected Output:
1 die another day.
0 i'm batman.
Anyone please help how to accept more than one string without any bugs. I am able to see after entering 2 my gets is taking newline as first string and later second string properly. Thanks in advance