My code for anti-blot system shows Runtime Error (sigabrt). Why is this so???
Please help!!!
#include
#include
using namespace std;
typedef long long ll;
int main()
{
std::ios_base::sync_with_stdio(false);
ll t;
cin>>t;
char c;
while(t–)
{
cin.get©;
string e;
ll len;
getline(cin,e);
len=e.length();
string s1,s2,s3;
ll first,last;
first=e.find_first_of(" “);
last=e.find_last_of(” ");
s1=e.substr(0,first);
s2=e.substr(first+3,last-2-(first+3));
s3=e.substr(last+1,len-(last+1));
/cout<<s1<<endl;
cout<<s2<<endl;
cout<<s3<<endl;/
if(s1.find(“machula”)!=string::npos)
{
ll a=stoi(s3,nullptr,10)-stoi(s2,nullptr,10);
//cout<<a<<endl;
s1.clear();
s1=to_string(a);
//cout<<s1<<endl;
cout<<s1 + " + " + s2 + " = " + s3<<endl;
}
else if(s2.find(“machula”)!=string::npos)
{
ll a=stoi(s3,nullptr,10)-stoi(s1,nullptr,10);
//cout<<a<<endl;
s2.clear();
s2=to_string(a);
//cout<<s2<<endl;
cout<<s1 + " + " + s2 + " = " + s3<<endl;
}
else
{
ll a=stoi(s1,nullptr,10)+stoi(s2,nullptr,10);
//cout<<a<<endl;
s3.clear();
s3=to_string(a);
//cout<<s3<<endl;
cout<<s1 + " + " + s2 + " = " + s3;
}
}
return 0;
}