
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;
int strLen = inbuff.length();
if (strLen<=4)
{
cout << inbuff << endl;
}
else
{
string frontStr = inbuff.substr(0,2);
string backStr = inbuff.substr(strLen-2,2);
cout << frontStr + backStr << endl;
}
}