False number in June Lunch Time Help

#include<iostream>

using namespace std;
int main()
{
int t;
cin >> t;
string str;
for(int i=0;i<=t-1;i++)
{
cin >> str;
if(str.at(0)==‘1’)
cout << “10”<<str.substr(1,str.length()-1) << endl;

    else
    cout << "1"<<str<<endl;      
}
return 0;

}

I wrote this code and custom input is showing expected results while when I try to compile without inputs then SIGABRT(runtime error) and
terminate called after throwing an instance of ‘std::out_of_range’
what(): basic_string::at: __n (which is 0) >= this->size() (which is 0) is thrown

Please help if anyone can help me find my mistake!

When you try to “RUN” (Not Compile) without input it is supposed to give error as their is no string as input . Just for reference , unlike Hackerearth/hackerrank you will have to write sample input in codechef during running it to see exact result on sample input .