daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Apr 23rd, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Const n = 5
  2. Dim A(n, n)
  3.  
  4. Sub func()
  5. Call zap
  6.  
  7. For i = 1 To n
  8. j = Max(i)
  9. Count = A(i, i)
  10. A(i, i) = A(i, j)
  11. A(i, j) = Count
  12. Next i
  13.  
  14. Call vivod
  15. End Sub
  16.  
  17. Function Max(i)
  18. Max = 1
  19. For j = 2 To n
  20. If A(i, j) >= A(i, Max) Then Max = j
  21. Next j
  22. End Function
  23.  
  24. Sub zap()
  25. For i = 1 To n
  26. For j = 1 To n
  27. A(i, j) = Cells(i, j)
  28. Next j
  29. Next i
  30. End Sub
  31.  
  32. Sub vivod()
  33. For i = 1 To n
  34. For j = 1 To n
  35. Cells(i + n + 2, j) = A(i, j)
  36. Next j
  37. Next i
  38. End Sub
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top