Home > Back-end >  I debugging results are right, but not through in the valley of los
I debugging results are right, but not through in the valley of los

Time:10-25

Konjac forgot password, but he still remember the password is composed of a string, the password is from the original string (of not more than 50 lowercase letters) each letter in the backward nn formation, the next letter is a z, so, he has found a move before the original string and nn, would you please find out the password,

Input format
The first line: n, the second line: a string of letters before moving

The output format
A line, is the password of the konjac

#include
#include
Char cha (char a, int n)
{
If (a<=122 & amp; & a> 122 - n % 26)
Return a + n % 26-26;

The else
Return a + n % 26;

}
Int main ()

{
Char cha (char a, int n);
Int n, b;
Char ch [1000], x;
The scanf (" % d \ n ", & amp; n);
Ch [n]='\ 0';

For (int I=0;; I++)
{
The scanf (" % c ", & amp; Ch [I]);
If (ch [I]=='\ n')
break;
X=cha (ch [I], n);
Printf (" % c ", x);

}
return 0;
}
  • Related