Tranvick

Untitled

Jun 25th, 2013
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int x = 5, b, a[20][20];
  6.  
  7. int main() {
  8. cin >> b;
  9. _asm {
  10. mov ecx, 1
  11. lea esi, a
  12. _loop:
  13. mov eax, ecx
  14. mul x
  15. push esi
  16. _l2:
  17. cdq
  18. div b
  19. mov [esi], edx
  20. add esi, 4
  21. cmp eax, 0
  22. jg _l2
  23.  
  24. pop esi
  25. add esi, 80
  26.  
  27. inc ecx
  28. cmp ecx, b
  29. jl _loop
  30. }
  31. for (int i = 0; i < b - 1; ++i) {
  32. int j = 19;
  33. while (a[i][j] == 0 && j > 1) --j;
  34. while (j >= 0) {
  35. cout << a[i][j] << " ";
  36. --j;
  37. }
  38. cout << endl;
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment