Problem taking input

my cod is
#include

using namespace std;

int main(){

int n;
cin>>n;
int no ;
int min = -1000;
int max= 1000;

for(int i= min; i<=max; i++){
cin>>no;
if(no>0){
cout<<no<<endl;
break;
}
else{
continue;
}
}

return 0;
}

is wrong but to write this simple input ?

you misinterprets the question

  1. you have to read and print the nos till the cumulative sum is positive
  2. don’t take min and max
    All numbers input are integers between -1000 and 1000.
    you didn’t have to handle this . this is the information that nos will lie in this range
    you didn’t have to do anything for this

Reference Code

first time taking input cin>>no;

first time taking input cin>>no; but why taking input in while loop?

we have to repeatedly take the input till the cumSum is +ve

so first i take single input to initialize the things
and then take input inside while loop repeatedly till cumSum is +ve

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.