Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- char s[100];
- int n;
- cin.getline(s, 100);
- _asm {
- lea esi, s
- xor eax, eax
- xor ecx, ecx
- _loop1:
- cmp byte ptr [esi], 0
- je _endl1
- cmp byte ptr [esi], ' '
- jne _noteq
- mov eax, esi
- _noteq:
- cmp eax, 0
- jne _noteq1
- mov edi, esi
- _noteq1:
- inc ecx
- inc esi
- jmp _loop1
- _endl1:
- mov ebx, eax
- sub ebx, edi
- push ebx
- lea ebx, s
- add ebx, ecx
- sub ebx, eax
- dec ebx
- inc eax
- add edi, 2
- _loop2:
- mov dl, byte ptr [eax]
- mov byte ptr [edi], dl
- inc eax
- inc edi
- dec ebx
- cmp ebx, 0
- jg _loop2
- pop ebx
- dec ebx
- sub eax, ebx
- cmp ebx, 0
- jng _end
- _loop3:
- mov byte ptr [eax], ' '
- inc eax
- dec ebx
- cmp ebx, 0
- jg _loop3
- _end:
- }
- cout << s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement