something about pow()函数
来源:互联网 发布:php spl 编辑:程序博客网 时间:2024/06/03 15:05
pow()函数返回double 类型,不可用%d输出,否则有误差。
测试代码:
#include<stdio.h>#include<iostream>#include<math.h>#include<algorithm>#include<string.h>using namespace std;int main(){int n,ans;for(int i=1;i<=10;++i){printf("%d\n",(int)pow(5,i));printf("%.0lf\n",pow(5.0,i));}return 0;}
运行结果:
0 0
- something about pow()函数
- Something about Perl (2) 函数 哈希表
- Something about ...
- Something about float divide
- something about Tomcat(zz)
- something about Listeners
- something about Macro
- Something about Music
- something about struts
- something about ado
- something about SEO
- Something About Pretect Mode
- something about this week
- Something about Ajax
- something about Ajax Ⅱ
- Something | About db-design
- Something About ! CSS
- Something About FLV视频
- yum安装软件报错:curl#6 - "Could not resolve host: mirrorlist.centos.org; Temporary failure in name resolut
- 中文文本分类-朴素贝叶斯
- hdu-5869 Different GCD Subarray Query gcd预处理 + 树状数组 + 离线
- 欢迎使用CSDN-markdown编辑器
- 【LightOJ 1274】Beating the Dataset(概率DP)
- something about pow()函数
- JS中Array方法中常用方法三:Array.prototype.join()
- blog字体测试
- September 10th 模拟赛C T1 电影票 Solution
- 决策树-信息增益,信息增益率,Gini
- 【JZOJ4772】运输妹子
- 51nod 迷宫问题
- 初中OJ1997【2015.8.3普及组模拟赛】WZK打雪仗(war)
- 解决Visual Studio2015使用Boost库 error C4996: 'std::copy::_Unchecked_iterators::_Deprecate'