Home > Back-end >  Input a string of characters (length less than 100) and a positive integer k, will be one of the Eng
Input a string of characters (length less than 100) and a positive integer k, will be one of the Eng

Time:06-05

#include
#include

Int main ()
{char ch;
Int I, k;
The scanf (" % d ", & amp; K);
K=k % 26;
For (I=1;; I++)
{the scanf (" % c ", & amp; Ch);
If ((ch>='a' & amp; & Ch<='y') | | (ch>='A' & amp; & Ch<='Z'))
Ch +=k;
Else if (ch=='z')
Ch='a';



Printf (" % c ", ch);
}
return 0;
}
This form to write this topic can do it, I don't know how to change, have bosses have a look

CodePudding user response:

1 do you have in this cycle is dead cycle
2 one character at a time, you can only input output immediately one character
3 you overlap after the encryption and decryption?

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related