Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- char s[100];
- cin.getline(s, 100);
- _asm {
- lea edi, s
- _loop1:
- cmp byte ptr [edi], ' '
- je _end_loop1
- inc edi
- jmp _loop1
- _end_loop1:
- inc edi
- mov esi, edi
- _loop2:
- cmp byte ptr [esi], ' '
- jne _end_loop2
- inc esi
- jmp _loop2
- _end_loop2:
- push esi
- xor ecx, ecx
- _loop3:
- inc ecx
- cmp byte ptr [esi], 0
- je _end_loop3
- inc esi
- jmp _loop3
- _end_loop3:
- pop esi
- cld
- repne movsb
- }
- cout << s << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment