dimanche 2 octobre 2016

c++ How to assign multiple numbers to multiple variables using one user input

What I have right now is:

int a = 0;
int b = 0;
int c = 0;

cin >> a >> b >> c; 

User Input is : 4 / 5 / 6

how do I assign 4 to a, 5 to b and 6 to c, given that there are "/" between the numbers in addition to the white space?

Aucun commentaire:

Enregistrer un commentaire