Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. int k = -1;
  7. char str[10];
  8. for (int i = 0; i < 10; i++)
  9. cin >> str[i];
  10. char c;
  11. cin >> c;
  12. __asm {
  13. pusha
  14. mov edx, 0
  15. mov ecx, 10
  16. lea sl, str
  17. mov bl, c
  18. search:
  19. cmp [sl], bl
  20. jz metka
  21. inc sl
  22. inc edx
  23. loop search
  24. jmp e
  25. metka:
  26. mov k, edx
  27. e:
  28. nop
  29. popa
  30. }
  31. if (k == -1) cout << "Символ в строке не найден" << endl;
  32. else cout << k << endl;
  33. system("pause");
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement