Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h>
- using namespace std;
- int main()
- {
- int x, s, z,answ;
- cout << "Type x" << endl;
- cin >> x;
- cout << "Type s" << endl;
- cin >> s;
- cout << "Type z" << endl;
- cin >> z;
- _asm{
- mov eax,x
- mov ebx,z
- imul ebx
- add eax,s
- cmp eax,0
- je EQL
- mov ecx,eax
- mov eax,s
- imul ebx
- mov ebx,eax
- mov eax,x
- sub eax,ebx
- mov ebx,s
- imul ebx
- cdq
- idiv ecx
- mov answ,eax
- jmp ANSW_
- }
- EQL:
- cout << "division by 0 is impossible " << endl;
- goto END;
- ANSW_:
- cout << "answer = " << answ << endl;
- END:
- system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment