C++中pow(x,y)函数怎么用?

如题所述

//假设要计算2的10次方
#include <stdio.h>
#include <math.h>
void main()
{
int data = pow(2,10);
printf("%d",data);
}
温馨提示:内容为网友见解,仅供参考
第1个回答  2017-12-27
pow(x,y)求的是x的y次方;
加上#include<math.h>就可以了;
#include<iostream.h>
#include<math.h>

void main()
{
cout<<pow(2,3);
}
相似回答