Error on String input of size 1 c++

I am getting segmentation fault ( core dumped ) , on input of string of size 1.

#include<bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
ll t,x,y;
string s;
cin>>t;
getline(cin,s);
while(t–){
getline(cin,s);
//cout<<"";
int tilt=0;
for(int i=s.length()-1,j=0;i>=s.length()/2;i–,j++){
if(s[i]!=s[j]){
tilt = s[i]>s[j]?-1:1;
s[i]=s[j];
}
}
if(tilt==-1 || tilt==0){
if(s.length()%2==0){
y=1;x=s.length()/2-1;
while(y!=0 && x>=0){
if(s[x]==‘9’){
s[x]=‘0’;
}else{
s[x] += 1;
y=0;
}
x–;
}
if(y==0){
for(int i=0;i<s.length()/2;i++){
cout<<s[i];
}
for(int i=s.length()/2-1;i>=0;i–){
cout<<s[i];
}
cout<<endl;
}else{
cout<<1;
for(int i=0;i<s.length()/2;i++){
cout<<s[i];
}
for(int i=s.length()/2-2;i>=0;i–){
cout<<s[i];
}
cout<<1<<endl;
}
}else{
y=1;x=s.length()/2;
while(y!=0 && x>=0){
if(s[x]==‘9’){
s[x]=‘0’;
}else{
s[x] += 1;
y=0;
}
x–;
}
cout<<"
";
if(y==0){
for(int i=0;i<s.length()/2;i++){
cout<<s[i];
}
for(int i=s.length()/2;i>=0;i–){
cout<<s[i];
}
cout<<endl;
}else{
cout<<1;
for(int i=0;i<s.length()/2;i++){
cout<<s[i];
}
for(int i=s.length()/2-1;i>=0;i–){
cout<<s[i];
}
cout<<1<<endl;
}
}
}else{
cout<<s<<endl;
}
}
return 0;
}

1.) Input :
1
1

Output:
Error

2.) Input:
1
11

Output:
22