Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. char v[]="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz";
  6. char s[256];
  7. char * c;
  8. int n;
  9. int main()
  10. {
  11. cin.getline(s, 256);
  12. cin>>n;
  13. for(int i=0;i<=strlen(s);i++)
  14. {
  15. if(s[i]==' ')
  16. {
  17. cout<<"A";
  18. }
  19. c = strchr(v, s[i]);
  20. cout<<c<<endl;
  21. }
  22.  
  23. return 0;
  24. }
  25. /* #include <iostream>
  26. #include <cstring>
  27. using namespace std;
  28.  
  29. char v[]="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz";
  30. char s[256];
  31. char * c;
  32. int n;
  33. int main()
  34. {
  35. cin.getline(s, 256);
  36. cin>>n;
  37. for(int i=0;i<=strlen(s);i++)
  38. {
  39. if(s[i]!=' ')
  40. {c = strchr(v, s[i]);
  41. cout<<c[n];
  42.  
  43. }
  44. else
  45. {
  46. cout<<" ";
  47. }
  48. }
  49.  
  50. return 0;
  51. }
  52. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement