Advertisement
add1ctus

Цезарова шифра

Jan 31st, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int x;
  8.     char a;
  9.     cin>>x;
  10.     while(cin>>a)
  11.         if(a+x<'z')
  12.             cout<<(char)(a+x);
  13.         else
  14.             cout<<(char)(2*'z'-x-a);
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement