-1

Sorry if the title is unclear.

Let's say I have a code that takes 3 variables, does something with them and then prints the output. My input would look something like this:

1
2
A

output once

What I want to do is paste more than 3 variables in to the terminal/console(sorry i'm not sure what is the proper name) and expect the code to run more than once, so it would something like this: input(pasted):

1
2
A

2
2
B

3
3
C

and i would like to see something like this:

Output for the 1 one
Output for the 2 one
Output for the 3 one

Is there a way to do something like this? If this has been asked before or is easy to find, i'm sorry, i don't really know how to search for this.

Catalina Chircu
  • 1,506
  • 2
  • 8
  • 19
Oti bushi
  • 1
  • 1

2 Answers2

0

Try adding while (n) followed by the logic and decrement the count of n inside the while loop

Subasri sridhar
  • 809
  • 5
  • 13
0

Instead of taking three inputs at a time why don't you take 9 or 11 (including spaces). Then run the same code you had before for the first three, and then the next, and then the next, skipping the spaces.