Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int k = -1;
- char str[10];
- for (int i = 0; i < 10; i++)
- cin >> str[i];
- char c;
- cin >> c;
- __asm {
- pusha
- mov edx, 0
- mov ecx, 10
- lea sl, str
- mov bl, c
- search:
- cmp [sl], bl
- jz metka
- inc sl
- inc edx
- loop search
- jmp e
- metka:
- mov k, edx
- e:
- nop
- popa
- }
- if (k == -1) cout << "Символ в строке не найден" << endl;
- else cout << k << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement