Strings-Difference in Ascii Codes

#include
#include
#include
using namespace std;

int main()
{
string s, smain = “”;
cin>>s;
cout<<s<<endl;

smain += s[0];

for(int i = 1; i < s.length(); i++)
{
    int digit = s[i] - s[i-1];
    //declaring ouput string stream
    ostringstream str1;
    str1<<digit;
    string insert = str1.str();
    
        smain += insert;
        smain += s[i];
   
    
     //cout<<smain<<endl;
    
}
 cout<<smain<<endl;

return 0;

}

I am getting a WA on all test cases what is wrong in my code