Tham khảo tài liệu 'lập trình c- bài tập 8', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | include include include Xóa khoảng trắng bên trái xâu void rtrim char s int i strlen s -1 while s i i 0 i-- s i 1 0 Xóa các khoảng trắng dầu xâu void ltrim char s int i 0 while s i i int length strlen s strncpy t s i strlen s -i for int k 0 k length k s k s k i Xóa các khoảng trắng thừa trong xâu void ctrim char s int i 0 while i strlen s -1 if s i s i 1 int k i do s k s k 1 while s k 0 else i Đem từ trong xâu int demtu char s int d 0 int len strlen s if s 0 d for int i 0 i len i if s i s i 1 d return d void main char s 100 cout Nhap xau gets s rtrim s Itrim s ctrim s cout s cout nSo tu demtu s endl