#include <stdio.h>
double power(double, int);
int main() { printf("%.2lf的%d次幂等于:%.2lf\n", 5.2, 2, power(5.2, 2)); return 0; }
double power(double num1, int num2) { double result = 1; int i; for (i = 0; i < num2; i++) { result *= num1; } return result; }
|