0

How can I take input like this?. I completed the code but I want to know other ways.

3 5 2 3 2 0 First row corresponds to goals scored by team A Second row corresponds to goals scored by team B. https://code.sololearn.com/cfAfbO0mM2I2/?ref=app

23rd Aug 2019, 2:38 AM
Geek
Geek - avatar
1 Answer
+ 1
Geek...you can try using gets function. you can store all goal of one team in one variable like below : char inputGoalA [500]; char inputGoalB [500]; gets(inputGoalA); gets(inputGoalB); with above, if you provide below input as it is : 1 2 3 2 3 4 inputGoalA would have value 1 2 3 and inputGoalB would have 2 3 4.... try to splitting with space from input and get individual game goal from both input.. HIH
23rd Aug 2019, 3:06 AM
Ketan Lalcheta
Ketan Lalcheta - avatar