Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- int main(int argc, char *argv[])
- {
- char litera;
- int liczba;
- string alfabetm = "abcdefghijklmnoprstuvwxyz";
- string alfabetw = "ABCDEFGHIJKLMNOPRSTUVWXYZ";
- cout << " input letter" << endl;
- cin >> litera;
- liczba=litera;
- if(litera>=97&&litera<=122){
- for(int i=0; i<=liczba-97; i++)
- cout << alfabetm[i];
- for(int i=liczba-98; i>=0; i--)
- cout << alfabetm[i];
- }
- if(litera>=65&&litera<=90){
- for(int i=0; i<=liczba-65; i++)
- cout << alfabetw[i];
- for(int i=liczba-66; i>=0; i--)
- cout << alfabetw[i];
- }
- cout << endl;
- system("PAUSE");
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment