Guest User

Untitled

a guest
Feb 25th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <string.h>
  2. #include <iostream>
  3. #include <locale>
  4.  
  5. using namespace std;
  6.  
  7. void main() {
  8.  
  9. setlocale(LC_ALL,"Russian");
  10. char s[50], s1[50];
  11. char* ps = s;
  12. char* ps1 = s1;
  13. int pp = 0;
  14. cout<<"Введите строку 1."<<endl;
  15. cin.getline(s,25);
  16. cout<<"Введите строку 2."<<endl;
  17. cin.getline(s1,25);
  18. while(*ps != 0){
  19. ps++;
  20. pp++;
  21. }
  22. while(*ps1 !=0){
  23. *ps=*ps1;
  24. ps++;
  25. ps1++;
  26. }
  27. *ps=0;
  28. cout<<"Скопированная строка."<<endl;
  29. cout<<s<<endl;
  30.  
  31. system("pause");
  32. }
Add Comment
Please, Sign In to add comment