Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int a[111][111], n, s, i, j, flg, sz;
- cin >> n;
- for (int i = 0; i < n; ++i)
- for (int j = 0; j < n; ++j) cin >> a[i][j];
- _asm {
- mov s, 0
- mov i, 0
- mov sz, 111
- _cicle1:
- mov eax, i
- cmp eax, n
- je _end
- mov flg, 0
- xor ecx, ecx
- xor ebx, ebx
- _cicle2:
- cmp ecx, n
- jge _end_cicle2
- push ebx
- push eax
- lea ebx, a
- mov eax, sz
- mul i
- shl eax, 2
- add ebx, eax
- mov eax, ecx
- shl eax, 2
- add ebx, eax
- mov edx, [ebx]
- pop eax
- pop ebx
- cmp edx, 0
- jne _not_zero
- mov flg, 1
- _not_zero:
- add ebx, edx
- inc ecx
- jmp _cicle2
- _end_cicle2:
- cmp flg, 1
- je _not_ok
- add s, ebx
- _not_ok:
- inc i
- jmp _cicle1
- _end:
- }
- cout << s << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment