WA1
I tried to do it with char input, the same happens.
tested everything I could find, but passed all the tests
don't know what to do
#include <iostream>
#include <string>
using namespace std;
int main()
{
string alf = "abcdefghijklmnopqrstuvwxyz";
char alp[26] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
string inp;
cin >> inp;
short *arr = new short[inp.length()];
short *out = new short[inp.length()];
short prev = 0;
for (short i = 0; i < inp.length(); i++)
{
short num = alf.find(inp[i]) + 1;
if (num <= 5)
num += 26;
while (arr[i - 1] > num)
num += 26;
arr[i] = --num;
}
out[0] = arr[0] - 5;
for (short i = 1; i < inp.length(); i++)
out[i] = arr[i] - arr[i - 1];
for (int i = 0; i < inp.length(); i++)
cout << alf[out[i]];
delete[] arr;
delete[] out;
return 0;
}