+ 1
How to take space-separated value input in C++?
12 Answers
+ 5
If you need help with your own code, link it so we can see what you tried. Without seeing what you did, we can't tell you what's wrong
+ 4
https://stackoverflow.com/questions/13096719/read-input-numbers-separated-by-spaces
Maybe it's helpful to you.
+ 4
in c++ by default when you get input with cin, it will start reading user input till meet a space or new line. So the answer is just use cin for every value you need to get.
I suggest you learn more on "c++ streams"
+ 3
You can get the input as string and then split the string at the separator into an array.
+ 1
I have already checked, I did not get the result I wanted.
+ 1
I have already checked ,idid not get the results I wanted.
+ 1
If you want to take a space between two values the use endl
Eg cout << "blabla" << endl;
0
Bhai log answer answer aa gya
Thanks everyone for helping.
0
Oooo
0
Aacha
0
bhai endl ke jagah ends use kerte hai!
0
Nahi bro ends se ek hi line me code output dikhaiga endl se tu dho statement ko alag kerskta hea
Eg cout << "hdhdusis" <<endl;
cout <<"HDHDHS";
OUTPUT: hdhdusis
HDHDHS
aiga verna ese aiga
hdhdusiHDHDHS