N
N
NoNIDs2018-10-12 13:54:53
C++ / C#
NoNIDs, 2018-10-12 13:54:53

How to make multiple input of numbers through cin depending on the value of the variable of its number?

To begin with, we enter a number through the console window, which will be the number of values ​​requested in the subsequent cin. It is also important that later these values ​​​​can be used somehow. For example: we enter the number 3.... then on the next line we must enter three numbers, and later use their values ​​in calculations. It is important to remember that the value that we enter first is in the range from 1 to 1000 inclusive and is an integer.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Tabris17, 2018-10-12
@Tabris17

cin>> n;
//тут условия проверки n можно сделать 
for (int i=0; i<n; i++)
 cin>> a[i];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question