开发者

How to calculate?

I just tried to calculate something. All my input is int.

int aveScore = (startScore/((([p1.arrayThrow count]-1)) + winPane.throws));  

The result is (for startscore = 501 and the rest = 3 [501/3 = 167]) 100. Even tried float aveScore which results in something l开发者_如何学Pythonike 10359. Also didn't work:

int aveScore = (float) ...  

What is wrong here?


int aveScore = (int)((float)startScore / (([p1.arrayThrow count] - 1) + winPane.throws));

EDIT:

If you want a floating point average score then it would just be:

float aveScore = (float)startScore / (([p1.arrayThrow count] - 1) + winPane.throws);

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜