Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. string lVar1 = CJSFunction(16, 3);
  2. private string CJSFunction(Int32 lBigNumberP, Int32 lDivisorP)
  3. {
  4. string sReturn = "";
  5. Int32 lRemainder = 0;
  6. Int32 dA = lBigNumberP % lDivisorP;
  7. Int32 dB = lBigNumberP / lDivisorP;
  8. if (dA == 0)
  9. {
  10. for (int i=0; i<lDivisorP; i++) {
  11. sReturn += dB+":";
  12. }
  13. }
  14. else
  15. {
  16. int lRunning = 0;
  17. for (int i = 1; i < lDivisorP; i++)
  18. {
  19. if (lRunning == 0)
  20. lRunning = dB + 1;
  21. lRemainder = lBigNumberP - lRunning;
  22. Int32 dC = lRemainder % (lDivisorP - i);
  23. Int32 dD = lRemainder / (lDivisorP - i);
  24. if (dC == 0)
  25. {
  26. //all the rest are equal
  27. sReturn = lRunning.ToString();
  28. for (int j = 0; j < (lDivisorP - i); j++)
  29. {
  30. sReturn += ":" + dD;
  31. }
  32. return sReturn;
  33. }
  34. else
  35. {
  36. if (sReturn + "" == "")
  37. {
  38. sReturn = (dB + 1).ToString();
  39. }
  40. else {
  41. sReturn += ":" + (dB + 1);
  42. lRemainder += (dB + 1);
  43. }
  44. }
  45. }
  46. sReturn = dA.ToString();
  47. }
  48. return sReturn;
  49.  
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement