Guest User

Untitled

a guest
Jul 21st, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3. #include <iostream.h>
  4. #include <string.h>
  5.  
  6. main ()
  7. {
  8.  
  9. char s[200],sl[200];
  10. int k;
  11. cout<<"Nhap xau s : "; gets(s);
  12. cout<<"Nhap vi tri thu k : ";
  13. cin>>k;
  14.  
  15. for(int i=0; i<k-1;i++)
  16. sl[i] = s[i];
  17.  
  18. cout<<"\n\nChuoi duoc cat tu dau den "<<k<<" la: "<<sl;
  19.  
  20. // Lay ben phai cung tuong tu. cho i tu` k-1 ->n-1. Day la cach khac
  21. cout<<"\n\nChuoi duoc cat tu "<<k<<" den cuoi la: "<<strchr(s,s[k]);
  22. getch();
  23. }
Add Comment
Please, Sign In to add comment