| prees (1) | |
|
Hey, I'm pretty good with Java but I'm taking a c++ course to learn it and I am hating it. anyways this is my question: I am trying to have the user input 2 integers (positive or negative) on the same line seperated by a space. The program should look like this: Enter the first rational number as numerator (space) denominator: -12 5 how do I go about this? can someone point me in the right direction? | |
|
|
|
| Moschops (5981) | ||
http://www.cplusplus.com/doc/tutorial/basic_io/ | ||
|
|
||
| James2250 (323) | |||
The user can always enter variables on the same line or on different lines with cin.
The user can either separate the values by a space or by a carriage return and it will put them into x and y correctly. (You could combine those cin statements into 1 if you wanted to as well). | |||
|
|
|||