Advertisement
Guest User

code compexity test

a guest
Feb 15th, 2020
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. int MyFunc(int a, int b)
  2. {
  3. int c = Func1(a)
  4.  
  5. int d = Func2(b)
  6.  
  7. return Func3(c, d)
  8. }
  9. </code>
  10.  
  11. з кодом колег
  12.  
  13. <code>
  14. void Func1()
  15. {
  16. this.c = 5 * Application.ACointainer.Instance.A
  17. }
  18. void Func2()
  19. {
  20. this.d = 10 * Application.BCointainer.Instance.B
  21. }
  22. void Func3()
  23. {
  24. this.result = this.c + this.d
  25. }
  26. ....
  27. void MyFunc()
  28. {
  29. Func1()
  30. Func2()
  31. Func3()
  32. }
  33. </code>
  34.  
  35. або ще краще
  36.  
  37. <code>
  38. void MyFunc()
  39. {
  40. this.result = 5 * Application.ACointainer.Instance.A + 10 * Application.BCointainer.Instance.B
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement