Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 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. mov bl, c
  17. search:
  18. cmp str[edx], bl
  19. jz metka
  20. inc edx
  21. loop search
  22. jmp e
  23. metka:
  24. mov k, edx
  25. e:
  26. nop
  27. popa
  28. }
  29. if (k == -1) cout << "Символ в строке не найден" << endl;
  30. else cout << k << endl;
  31. system("pause");
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement