hey cormac look below:
the problem said for the last test case should be: 0 0
but the judge data has no input like 0 0
now for this coding technique you will get wa in this problem
Code: Select all
#include<stdio.h>
int main()
{ long i,n,q;
char c;
while(scanf("%ld%ld",&n,&q)==2)
{ if(n==0&&q==0)
break;
for(i=0;i<q;i++)
{
scanf("%ld%c%ld%c",&n,&c,&n,&c);
}
/*other porcesses*/
} return 0;
}
though the coding technique is right
Now when you write like this:
Code: Select all
#include<stdio.h>
int main()
{ long i,n,q;
char c;
scanf("%ld%ld",&n,&q);
for(i=0;i<q;i++)
{
scanf("%ld%c%ld%c",&n,&c,&n,&c);
}
/*other porcesses*/
return 0;
}
you will get ac which is not right at all.
cormac i think you have understand the problem.
im here not to make any unhealthy discussion.
it costs valuable time(while im coding for different problem right now)
i think the judge should take correction. at least
include the ending input: 0 0
best regard
tanvir[/code]