Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Online C++ Compiler.
- Code, Compile, Run and Debug C++ program online.
- Write your code in this editor and press "Run" button to compile and execute it.
- *******************************************************************************/
- #include <iostream>
- #include <string.h>
- using namespace std;
- char nr_lit[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'};
- int findposition(char a)
- {
- int i = 0;
- for(i = 0; i < 26; i++)
- {
- if(a == nr_lit[i])
- break;
- }
- return i;
- }
- int main()
- {
- char cuvant[45];
- int numar_modulo[45];
- cin>>cuvant;
- for(int k = 26; k >= 0; k--)
- {
- for(int i = 0; i <strlen(cuvant); i++)
- {
- if(cuvant[i] == 'a')
- cuvant[i] = 'z';
- else
- cuvant[i] = nr_lit[findposition(cuvant[i])-1];
- cout<<cuvant[i];
- }
- cout<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement