Tranvick

Untitled

May 21st, 2013
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int a[111][111], n, s, i, j, flg, sz;
  7.     cin >> n;
  8.     for (int i = 0; i < n; ++i)
  9.         for (int j = 0; j < n; ++j) cin >> a[i][j];
  10.     _asm {
  11.         mov s, 0
  12.         mov i, 0
  13.         mov sz, 111
  14. _cicle1:
  15.         mov eax, i
  16.         cmp eax, n
  17.         je _end
  18.         mov flg, 0
  19.         xor ecx, ecx
  20.         xor ebx, ebx
  21. _cicle2:
  22.         cmp ecx, n
  23.         jge _end_cicle2
  24.         push ebx
  25.         push eax
  26.         lea ebx, a
  27.         mov eax, sz
  28.         mul i
  29.         shl eax, 2
  30.         add ebx, eax
  31.         mov eax, ecx
  32.         shl eax, 2
  33.         add ebx, eax
  34.         mov edx, [ebx]
  35.         pop eax
  36.         pop ebx
  37.         cmp edx, 0
  38.         jne _not_zero
  39.         mov flg, 1
  40. _not_zero:
  41.         add ebx, edx
  42.         inc ecx
  43.         jmp _cicle2
  44. _end_cicle2:
  45.         cmp flg, 1
  46.         je _not_ok
  47.         add s, ebx
  48. _not_ok:
  49.         inc i
  50.         jmp _cicle1
  51. _end:
  52.     }
  53.     cout << s << endl;
  54.     return 0;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment