Input
The file contains several lines of input. Each line contains three data. First is the X number of hops that you will
do to the given input, where -1 <X <101. Second, the stop character S. Lastly, the input data D, where its size
will not exceed 100 characters.
Output
For each line of input, output the next letter after visiting the required X number of characters or once the
stop character has been visited. Should the next character be a space, display the word space.
Sample Input
10 . This is a competition!
15 i I love programming, I love programming.
0 x joshua
5 g goofy, the great!
2 s he wants to sing
Sample Output
c
i
j
o
space
I'd very much appreciate any kind of help. Thanks in advance!
What about ignore() ?
What you need to do is "cin>>" an integer, get() a char and then getline() the sentence. You'll need to ignore() spaces in between, though you may get() them too. When you do that, you only need a simple for loop.
The input should be in a txt file. so im going to use ifstream.
Each line contains three data. First is the X number of hops that you will
do to the given input, where -1 <X <101. Second, the stop character S. Lastly, the input data D, where its size
will not exceed 100 characters.
how do i read the values? -__- i really dont know what to do with it. oh, and the ignore() is to be used in the second data. for example: 10 . This is a competition! --> The second data is . which means i'll have to ignore periods in the sentence "This is a competition!"