Guest User

Untitled

a guest
Jan 4th, 2018
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. int main(int argc, char *argv[])
  8. {
  9. char litera;
  10. int liczba;
  11. string alfabetm = "abcdefghijklmnoprstuvwxyz";
  12. string alfabetw = "ABCDEFGHIJKLMNOPRSTUVWXYZ";
  13.  
  14. cout << " input letter" << endl;
  15. cin >> litera;
  16. liczba=litera;
  17.  
  18. if(litera>=97&&litera<=122){
  19. for(int i=0; i<=liczba-97; i++)
  20. cout << alfabetm[i];
  21. for(int i=liczba-98; i>=0; i--)
  22. cout << alfabetm[i];
  23. }
  24.  
  25. if(litera>=65&&litera<=90){
  26. for(int i=0; i<=liczba-65; i++)
  27. cout << alfabetw[i];
  28. for(int i=liczba-66; i>=0; i--)
  29. cout << alfabetw[i];
  30. }
  31.  
  32. cout << endl;
  33. system("PAUSE");
  34. return EXIT_SUCCESS;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment