首页 > 其他分享 >power函数

power函数

时间:2023-01-25 22:11:09浏览次数:32  
标签:lf include return 函数 power double main

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

#include<iostream>

double power(double x, double y)
{
double z = 1;
while(y)
{
z *= x;
--y;

}
return z;

}
void main()
{
double x, y, z;
scanf("%lf %lf", &x, &y);

z = power(x, y);

printf("%lf的%lf次方是%lf\n", x, y, z);

标签:lf,include,return,函数,power,double,main
From: https://blog.51cto.com/u_15896475/6022969

相关文章