C++帮忙翻译解释一下题目
ProblemDescriptionLittlePetyalikesnumbersalot.Hefoundthatnumber123inbase16consistsoft...
Problem Description
Little Petya likes numbers a lot. He found that number 123 in
base 16 consists of two digits: the first is 7 and the second is 11. So the sum
of digits of 123 in base 16 is equal to 18.
Now he wonders what is an average
value of sum of digits of the number A written in all bases from 2 to
A-1.
Note that all computations should be done in base 10. You should find
the result as an irreducible fraction, written in base 10.
Input
Input contains one integer number A (3<=A<=1000).
Output
Output should contain required average value in format X/Y,
where X is the numerator and Y is the denominator.
Sample Input
5
3
6
Sample Output
7/3
2/1
9/4 展开
Little Petya likes numbers a lot. He found that number 123 in
base 16 consists of two digits: the first is 7 and the second is 11. So the sum
of digits of 123 in base 16 is equal to 18.
Now he wonders what is an average
value of sum of digits of the number A written in all bases from 2 to
A-1.
Note that all computations should be done in base 10. You should find
the result as an irreducible fraction, written in base 10.
Input
Input contains one integer number A (3<=A<=1000).
Output
Output should contain required average value in format X/Y,
where X is the numerator and Y is the denominator.
Sample Input
5
3
6
Sample Output
7/3
2/1
9/4 展开
展开全部
任意给一个10进制数A(3<=A<=1000),将其依次从2进制转换到A-1进制,得到A-2(即Y)个数,将每个数的各个数位上的数字按十进制求和,得到X。最后输出X/Y。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
自己看不懂的东西就不要再看了,先看国语的吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
充分利用网络啊,baidu、google翻译等等都不错啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询