Please make correct while loop in the function. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Please make correct while loop in the function.

https://code.sololearn.com/cTVd3bMegojk/?ref=app

22nd Aug 2021, 6:58 PM
TeaserCode
2 Answers
0
Blurred list Given is a set A with elements of integers greater than 0. In addition, we have two constants m and v greater than 0. We define a new set B with the following rule: the integer x belongs to the set B exactly when at most m is lesser than and for v greater than some element of the set A. In other words, B contains, in addition to each element of the set A, the previous m and the following v integers. We do not know the size of the set A, we access it with the next () function, which we write ourselves. With each call, it returns one element of set A. When it reaches the end of the set, it returns -1. The function prints out the elements of set B in real time before reading the next element of set A should write all those elements of set B that we assume belong to this set. Example: int m=2, v=1; A={1,3,4,9}; Than B={-1,0,1,2,3,4,5,6,7,8,9,10};
23rd Aug 2021, 7:46 PM
TeaserCode
0
But I try to study . If anyone knows the principles of programming languages, he should know what my exercise wants.
25th Aug 2021, 11:29 AM
TeaserCode