travelers's blog

By travelers, history, 8 years ago, In English

Sometimes there are some problems which has input description like this problem in Uva. Can anyone tell me how to take input and how to stop taking input for this type of problems TIA...

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
8 years ago, # |
  Vote: I like it +2 Vote: I do not like it

One word: getline

  • »
    »
    8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    As Swistakk says

    Anyway, to let you have multiple choices, here, take look: Each "while" can [or at least I hope so] read lines, until EOF /OR/ blank-line → so make your choice

    You can also do it 1by1 with getchar(), anyway it is too much work! ;-)

    Have Nice Day & Good Luck

    [At least according to "C++"]