Hello,
I am trying to solve a problem where requirements are little vague and input could come as multiline like:
5 5
5 5 N
1 2 I
and I am doing some processing of the input using an algorithm and returning back the output also as multiline:
3 4
2 3
What is stopping me currently is that I am not able to figure out the best data structure to accept input and return output.
The program is not interactive and the multiline input comes in one shot and I need to return back multiline output in one shot after required processing is done.
I do not know if I should work with input/output as a String or with a file or is there a better way to handle this.
I would really like to seek ideas as to the best way to work with such examples of input/output.
If I do it using Strings, my program invoker really has to use \n characters in the input which does not look good to me.
If I do it using File, it might impact my program structure if I want to expose my service as remote service.
I know it is too basic but I would appreciate some ideas here..
thanks
I am trying to solve a problem where requirements are little vague and input could come as multiline like:
5 5
5 5 N
1 2 I
and I am doing some processing of the input using an algorithm and returning back the output also as multiline:
3 4
2 3
What is stopping me currently is that I am not able to figure out the best data structure to accept input and return output.
The program is not interactive and the multiline input comes in one shot and I need to return back multiline output in one shot after required processing is done.
I do not know if I should work with input/output as a String or with a file or is there a better way to handle this.
I would really like to seek ideas as to the best way to work with such examples of input/output.
If I do it using Strings, my program invoker really has to use \n characters in the input which does not look good to me.
If I do it using File, it might impact my program structure if I want to expose my service as remote service.
I know it is too basic but I would appreciate some ideas here..
thanks