标签:double es2017 img stdio.h math.h clu 技术 src images
#include<stdio.h>
#include<math.h>
//power函数
double  power(double x,double  y);
int  main()
{
	double x = 2.0, y = 3.0, z;
	z = power(x, y);
	printf("%f\n",z);
	while (1);
	return 0;
}
double  power(double x, double  y)
{
	double z = 1.0;
	while (y)
	{
		z =z*x;
		--y;
	}
	return z;
}
结果:

标签:double es2017 img stdio.h math.h clu 技术 src images
原文地址:http://www.cnblogs.com/panyani-532355476/p/7828374.html