Nearly right.
Instead of
scanf("%c",&c)
put a space in the " %c". The space makes the scanf match zero or more white
space characters, which will consume stray end-of-line characters.
In the final
char str[5]={r1,r2,r3,r4,r5};
//cout<<str<<endl;
printf("%s\n", str);
make sure the str is a properly terminated string. So write
char str[6]={r1,r2,r3,r4,r5,0};
//cout<<str<<endl;
printf("%s\n", str);
Did you run your code with the Google python scripts?
With those scripts you can write to stderr (as long as it isn't too much) and
debug that way.
--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-code/b19a1686-1def-4277-815a-5c3cbc8daa6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.