0
I want to make the program require me to enter a second number in order to plus them. But it does require me to type the second?
It does require me to type the first one but for the socond one it doest. it determines from its own.
9 Antworten
+ 4
The code is not an issue, what you wrote is right. The problem is what you wrote in the little input window. You should write :
5
4
As @Dextozz suggested :)
+ 4
can you show the code please ?
PS : if it does not ask you to enter the second on sololearn, it is because sololearn ask all inputs before running the program
+ 4
Yes. that's it :/
Try entering a and b on two separate lines, it should work !
https://www.sololearn.com/discuss/659854/?ref=app
+ 2
I m coding like
int a;
cin >> a;
int b;
cin >> b;
and run then it only wants me to enter the int a , why not asking the same for the int b ?? is it because you re saying solo learn right ? when I use the code somewhere else it will ask ?
+ 2
Yes it's because of SoloLearn. Just input everything at once and it will work. My guess is when you input for eg.
5
4
It stores those inputs in a list or an array and whenever it reaches a cin it takes the first not used value from that list.
+ 1
oooh I got it thank you very much @Baptiste E. Prunir and @Dextozz
0
you mean by two seperate lines : int a ; <<endl int b;
???? @Baptiste E. Prunir
0
can you pls write the right codes ? I m very new at coding :)
0
SoloLearn de bütün degerleri tek seferde alabilirsin bu sololearn in kendinden kaynaklaniyor yukaridaki arkadasin dedigi gibi. Yani:
cin>> a>> b>> c;
yazarak alirsin. Deger girerken de aralarinda bosluk koyman gerekir yani
3 14 289 seklinde. (a=3 , b=14, c=289)