Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string lVar1 = CJSFunction(16, 3);
- private string CJSFunction(Int32 lBigNumberP, Int32 lDivisorP)
- {
- string sReturn = "";
- Int32 lRemainder = 0;
- Int32 dA = lBigNumberP % lDivisorP;
- Int32 dB = lBigNumberP / lDivisorP;
- if (dA == 0)
- {
- for (int i=0; i<lDivisorP; i++) {
- sReturn += dB+":";
- }
- }
- else
- {
- int lRunning = 0;
- for (int i = 1; i < lDivisorP; i++)
- {
- if (lRunning == 0)
- lRunning = dB + 1;
- lRemainder = lBigNumberP - lRunning;
- Int32 dC = lRemainder % (lDivisorP - i);
- Int32 dD = lRemainder / (lDivisorP - i);
- if (dC == 0)
- {
- //all the rest are equal
- sReturn = lRunning.ToString();
- for (int j = 0; j < (lDivisorP - i); j++)
- {
- sReturn += ":" + dD;
- }
- return sReturn;
- }
- else
- {
- if (sReturn + "" == "")
- {
- sReturn = (dB + 1).ToString();
- }
- else {
- sReturn += ":" + (dB + 1);
- lRemainder += (dB + 1);
- }
- }
- }
- sReturn = dA.ToString();
- }
- return sReturn;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement