+ 1
How to take input just separated by one space ?[NOT FOR SOLOLEARN COMPILER]
https://code.sololearn.com/c4EIYv8s2hvx/?ref=app In the problem question was asked to input one pair of integers per line and those number should be separated by space. For example: if you are about input two number let assume 4 and 5 you must enter it like: 4 5 You are not allowed to hit enter after entering one number, it must separated by space. my question: is there any specific methods to input anything just separated by space ? Or it works fine without doing anything ? Because i am using CodeBlocks IDE and it just works fine for both space and enter without doing anything. Is it works for all IDE, Platform or anywhere ?
3 Réponses
+ 1
I'm working on Visual Studio.
For this:
Get input from user using getline function.
And store this input into a character array.
After input run a while loop until
c != '\n'
And copy values to other arrays.
On whitespace. You can define what do you want to do..
0
No. We have to define this process.
0
C ++ okay! I will try:) Thanks