|
|
back to boardTo All Those Who are getting WA #3 Hi, When you read the input, don't just concatenate all into one string. For example:- If the input is asasa.!sds sdsdsd!!!..::dsd Then, you should have a final string which is like this:- asasa.!sds sdsdsd!!!..::dsd and not like this asasa.!sdssdsdsd!!!..::dsd (this is wrong and will screw up) There should be a space between the two lines which you are reading and concatenating ! Re: To All Those Who are getting WA #3 Thank you very much!!! Re: To All Those Who are getting WA #3 Well, I've got another stupid mistake with WA#3, you could detect it with test "aB" (answer is 2). Btw, in this problem one might consider reading a whole input at once. In C/C++ such reading might look like below: > FILE *source = stdin; > fseek(source, 0, SEEK_END); > long textLength = ftell(source); > rewind(source); > char* text = (char*)malloc(sizeof(char)*textLength); > fread(text,1,textLength,source); |
|
|