Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- #include <iostream.h>
- #include <string.h>
- main ()
- {
- char s[200],sl[200];
- int k;
- cout<<"Nhap xau s : "; gets(s);
- cout<<"Nhap vi tri thu k : ";
- cin>>k;
- for(int i=0; i<k-1;i++)
- sl[i] = s[i];
- cout<<"\n\nChuoi duoc cat tu dau den "<<k<<" la: "<<sl;
- // Lay ben phai cung tuong tu. cho i tu` k-1 ->n-1. Day la cach khac
- cout<<"\n\nChuoi duoc cat tu "<<k<<" den cuoi la: "<<strchr(s,s[k]);
- getch();
- }
Add Comment
Please, Sign In to add comment