Why i get SIGABRT in the following code

#include<bits/stdc++.h>

using namespace std;

int main(){
int t;
cin>>t;
while(t–)
{
int n;
cin>>n;
char p=‘9’;
int q=stoi(string(n,p));
int m=(q/10)+1;
for(int i=m;i<=q;i++)
{
int sum=0;
int b[n];
int e=i;
int k=0;
while(e>0)
{
b[k]=e%10;
e/=10;
k++;
}
for(int j=0;j<n;j++)
{
sum=sum+b[j]*b[j];
}
double sr=sqrt(sum);
int flag=0;
int d=i;
while(d!=0)
{
int curr_digit = d % 10;
if (curr_digit == 0)
{
flag=1;
break;
}
d/= 10;
}

        if(((sr - floor(sr)) == 0) && (flag==0))
        {
            cout<<i<<endl;
            break;
        }
        else continue;
    }
}
return 0;

}