Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <cstdlib>
- #include <time.h>
- #include <cstring>
- using namespace std;
- int i;
- char x;
- string a="abcdefghijklmnoprstuwqxvyz_1234567890";
- string b="09876543214mnbvcxzlkjhgfdsapoiuytrewq";
- string c;
- int main()
- {
- while(true)
- {
- cout<<"Wpisz x jesli chcesz zamienc znaki lub downolny znak by odwrucic! "<<endl;
- cin>>x;
- system( "cls" );
- cout<<"Podaj wyraz w ktorym chcesz zamienic znaki: "<<endl;
- cin>>c;
- if(c=="koniec") //warunek
- {
- exit(0);
- }
- if(x=='x')
- {
- int n=c.length();
- for(i=0; i<n; i++)
- {
- int h=b.find(c[i]);
- cout<<a[h];
- }
- cout<<endl;
- }
- else
- {
- int l=c.length();
- for(i=0; i<l; i++)
- {
- int h=a.find(c[i]);
- cout<<b[h];
- }
- cout<<endl;
- }
- system("pause");
- system( "cls" );
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement