#include <math.h>后,直接可以pow(a,b)这样求得指数
#include <stdio.h>
#include <math.h>
void main()
{
double d = pow(1.0/3,-2) +pow( (sqrt(2010.0) - sqrt(2012.0)),0);
printf("%lf",d);
}
如下:
#include <stdio.h>
#include <math.h>
int main()
{
double s = pow(1.0/3,-2) + pow((sqrt((double)2010)-sqrt((double)2012)),0);
printf("%lf\n",s);
return 0;
}