Code changes ..........,,,,,

#include
#include
using namespace std;
int main() {
int t;
cin>>t;

while(t-->0){
	int a[10000]={0};
    int n;
    cin>>n;
	int cs=0;
    int ms=0;
    for(int i=0;i<n;i++){
	    cin>>a[i];
    }
    for(int i=0;i<n;i++){
	    cs=cs+a[i];
	    if(cs<0){
		    cs=0;
	    }ms=max(cs,ms);
    }cout<<ms;
}

return 0;

}

Please copy paste your code in coding blocks IDE. Save it and send me the link. This way it is easier to debug and for you to understand the changes as well.

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.