Sorry I answered too carelessly last time. After consideration this question is much more complicated than I thought. So here I will discuss according to different conditions:
First we see the outside while loop. J is increased by 0.1*n. So after 10 times J will be more than n.
Here according to different n, j will be increased into different numbers such as even odd or floating number, which will further influence the if else condition in the inner loop.
However, we can see that the condition of if sentence is that when k is odd, and then the statement is K++, so next step k will absolutely be a even number. What does this mean?
Case1
This means for the best assumption, the if condition when k is odd will be executed at most as same times as the else condition, where 0.01n should be odd number which means n is odd number times hundred as well as the initial value of k is integer. And here if we check into deeper details, we can find that the case when initial k is integer we must have J+=0.1*n to be integer. So lets discuss that when we want 0.01n to be odd(surely 0.1n will be integer too), we have 1/200 chance for every n value that is possible to be input(i.e. when n is input from 1 - 1000, we only have 100, 300, 500, 700 and 900 that meet requirement for all the 1000 numbers). So it would be a quite rare condition to meet all these requirements. Temporarily we don't know whether it will have impact on the worst case, we will discuss this later.
Case2
Then, what is the case that 0.1*n is integer but 0.01*n is not odd which will happen more than the case about? in this case, even if k initial is odd, it will soon be even because the statement is K++. And then because 0.01n is floating number, so the case K+= 0.01n will dominate until k surpasses n. So here for the ten initial values k will get: 1, 1+0.1n, 1+0.2n, 1+0.3n ... 1+0.9n. we will have 0.01n*t <= n-1, 0.01n*t<=0.9n -1 0.01n*t <=0.8n -1... 0.01n*t <= 0.1n -1. t = (n-1)/0.01n ...t = (0.1n -1)/0.01n. assume n is a big number, then the result will be simplified as sum = 100 + 90 + 80 + ... 10 = 550 constant time. Here since k+0.01n dominates, 0.1n is integer has no meaning any more, the case 0.1n is floating number and 0.01*n is not odd have the same time complexity.
Case3
Afterwards, the case 0.1*n is not integer but 0.01*n is odd is not possible.
Case4
Another case is that when 0.1n is integer but 0.01n is xxx.5. Here when the else condition k = +0.01n operate two times, k value will be odd again, so its like 1/3 of total time execute k++ 2/3 of time execute k += 0.01n. so for the ten time outloop operation, the inner operation will be 1/3*t + 2/3*0.01n*t <=n....1/3*t + 2/3*0.01n*t <=0.1n, here t = 3n/(1 + 0.02n)...t = 0.3n/(1 + 0.02n). sum = 16.5n/(1+0.02n)
when 0.02n is much bigger than 1, i.e. n = 5000, t = 825 times.
when 0.02n is close to 1, i.e. n = 500, t = 750
when 0.02n is equal to 1, n = 50, t = 412.5
...the trend is decreasing, so we just take larger n into account.
Case4.1
here I have two observations, the first one is that there are many more conditions like 4*0.01n is odd or 6* 0.01n is odd, the ratio of time will be 1/5 4/5 and 1/7 6/7, the sum of t will be 684 when n = 5000 for 1/5 ratio, and 639.5 for n = 5000 for 1/7 ratio. and finally it will be infinitely closer to 550 because 0.01n will increase more than 1 and the chance 0.01n happen is also increasing, and finally the condition became case 2 we talked above.
Case4.2
However, when n is small, then 0.01n and 1 all have visible impact on the time complexity, but, since n is small, we can get k more than n easily so the total time will not surpass 825 times.
for the case that k+=0.1n is floating number but k+=0.01n will make k back to odd again, the process is similar above, so we don't discuss it and take the result above.
Here we can see that whether k+=0.1n is integer or floating number actually don't meaning too much. the key point is how many time does k+=0.01 and k++ takes.
Case5
Finally we get into the worst case. in this case, the initial value of k is integer and 0.01n is odd. Here the ratio is 1/2 1/2, and the total time cost will be 1078 times. actually this is also a alternative to the condition that k is integer and 0.01n is xxx.5.
for n quite small, the time it cost will just be smaller.
Overall
so overall, the average time cost is 550 for both 0.1n and 0.01n are floating numbers and the worst case is 1078 for k is integer and 0.01n is odd.
sorry for the long and disordered answer, in summary, here are three things to consider.
1.the ratio of if condition and else condition that will be operated.
2.the value of n, whether 1 has much more contribution to the adding process or 0.01n has more.
3.Then the average condition is that numbers are always floating numbers and we execute k+=0.01n only. this is the most condition.
Hope this is readable lol