2047| 3
|
求帮助。。看看我的思路对不对 |
1鱼币
最佳答案#include
int main() {
int p, r;
int result;
int tmp;
puts("输入整数:p>0, r>0,求解p^r");
scanf("%d%d",&p,&r);
tmp = r;
result = 1;
while( tmp ) {
result *= p;
--tmp;
}
printf("用while求p^r=%d\n", result);
tmp = r;
result = 1;
do {
result *= p;
--tmp;
}while(tmp);
printf("用do while求p^r=%d\n", result);
tmp = r;
result = 1;
for(tmp=r,result= ...
| ||
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
|
||
发表于 2014-4-18 11:59:45
|
显示全部楼层
| ||
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
|
||
发表于 2014-4-18 15:47:50
|
显示全部楼层
| ||
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
|
||
发表于 2014-4-18 17:39:30
|
显示全部楼层
| ||
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
|
||
小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)
GMT+8, 2024-12-26 02:09
Powered by Discuz! X3.4
© 2001-2023 Discuz! Team.