What is the error in the code ? it is showing runguard: warning: timelimit exceeded (wall time): aborting command runguard: warning: command terminated with signal 15 error

#include
using namespace std;.
int main()
{
int n;
cin>>n;
int a[100];
int cummsum[100]={0};
int currsum=0
int maxsum=0;
int left=-1;
int right=-1;
cin>>a[0];
cummsum[0]=a[0];
for(int i=1; i<n; i++){
cin>>a[i];
cummsum[i]=cummsum[i-1]+a[i];

}

for(int i=0; i<n; i++){

	for(int j=i; j<n; j++){
         currsum=0;

        if(i=0){
            currsum=cummsum[j];
        }
        else{
            currsum=cummsum[j]-cummsum[i-1];
        }

	
		if(currsum>maxsum){
			maxsum=currsum;
			left=i;
			right=j;
		}
  }
}
cout<<"maximum sum among the subarrays:"<<" "<<maxsum<<endl;
for(int k=left; k<=right; k++){
	cout<<a[k]<<" ";
}

return 0;

}

Save your code on ide.codingblocks.com and then share its link