Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main() {
- const int n = 100;
- char stroka[n + 1];
- cout « "Input string" « endl;
- //cin » stroka;
- //fgets(stroka, sizeof(stroka), stdin);
- cin.getline(stroka, sizeof(stroka));
- int LenS;
- //вычисление длины строки
- __asm {
- mov ecx, n
- lea edi, stroka
- mov esi, edi
- cld
- mov al, '\0'
- repne scasb
- sub edi, esi
- dec edi
- mov LenS, edi
- }
- stroka[LenS] = ' ';
- stroka[LenS + 1] = '\0';
- LenS++;
- char sim;
- __asm {
- xor ecx, ecx
- mov ecx, LenS
- xor esi, esi
- xor ebx, ebx
- xor edx, edx
- xor edi, edi
- r1: mov al,stroka[esi]
- cmp al,' '
- jne NoProb
- mov ebx,0
- jmp pereh
- NoProb: cmp ebx,0
- jne noFirst
- inc ebx
- mov sim,al
- jmp pereh
- noFirst: cmp al,sim
- jne pereh
- mov stroka[esi],'.'
- pereh : add esi, 1
- loop r1
- }
- cout « endl « "" « stroka;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement