今天图老师小编要跟大家分享用c++实现x的y次幂的代码,精心挑选的过程简单易学,喜欢的朋友一起来学习吧!
【 tulaoshi.com - 编程语言 】
代码如下所示:
代码如下:
PRE class=cpp name="code"#include stdio.h
#include math.h
int main()
{
int x,y;
printf("求x的y次幂:n");
scanf("%d %d",&x,&y);
printf("结果是:%.2f",pow(x,y)); //要以%f输出 %d输出结果都是0
return 0;
}
/PREBR
PRE/PRE
P /P
PRE/PRE
PRE/PRE
来源:http://www.tulaoshi.com/n/20160219/1590699.html
看过《用c++实现x的y次幂的代码》的人还看了以下文章 更多>>