
Patrick B. answered 04/27/21
Math and computer tutor/teacher
using namespace std;
#include <iostream>
#include <string>
main()
{
string inbuff;
cout << "Input :>";
cin >> inbuff;
string front3 = inbuff.substr(0,3);
string subStr = inbuff.substr(1,3);
if (
(front3.compare("cat")==0) || (subStr.compare("cat")==0)
)
{
cout << "true" << endl;
}
else
{
cout << "false" << endl;
}
}