![](https://static.youtibao.com/asksite/comm/pc/images/content_title_q.png)
设计一个程序,通过引用来计算一个非零整数的每一位上的数字的平方和,结果的符号由该整数的符号决定。 例如: 156 的结果为 1 2 +5 2 +6 2 = 62 ; -156 的结果为 -()操作来分离一个整数每一位上的数字。在分离数字之前要先去掉该整数的符号,不能带着符号进行取余操作
![](https://static.youtibao.com/asksite/comm/pc/images/content_title_a.png)
解析:#include
解析:#include
第2题
第4题
第5题
在main()方法中编写代码通过RandomIntSequence的方法获得前10个随机整数,并计算它们的平均值。
第6题
第7题
A.第11行: ret != 0第29行: i<=number第31行: number / i == 0
B.第11行: ret != 0第29行: i<=sqrt(number)第31行: number % i == 0
C.第11行: ret == 0第29行: i<=sqrt(number)第31行: number / i == 0
D.第11行: ret == 0第29行: i<=number第31行: number % i == 0
第8题
m是一个整数.
(1)若m=p/q,其中p与q为非零整数,且m2是一个整数
(2)若m=p/q,其中p与q为非零整数,且(2m+4)/3是一个整数E.