Y=(X的平方)用C++的程序怎么写,要全面一点,急用,谢谢

来源:百度知道 编辑:UC知道 时间:2024/06/22 22:13:55
我们上课.老师说要上午下课前交~~望大家帮帮忙啊`~~
Y=(X的平方)在平面坐标轴上画一个开口向上的抛物线,用画图工具画出

y=x*x

pow <math.h>

double pow( double x, double y );

Parameters
x
Base
y
Exponent

Example

#include <math.h>
#include <stdio.h>

void main( void )
{
double x = 2.0, y = 3.0, z;

z = pow( x, y );
printf( "%.1f to the power of %.1f is %.1f\n", x, y, z );
}

Output
2.0 to the power of 3.0 is 8.0