power() 函数返回一个double类型数的正整数次幂。改进 该 函数,使其能正确计算负幂。函数要处理0的任何次幂都为0,任何数的0次幂都为1.(自学留痕)
#include<stdio.h>
#include<stdlib.h>
double power( double n, int p);
// ANSI 函数 原型
int main(void)
{
double x, xpow;
int exp;
printf(" Enter a number and the positive integer power");
printf(" to which\nthe number will b...
原创
2022-04-01 17:18:28 ·
330 阅读 ·
0 评论