码迷,mamicode.com
首页 > 其他好文 > 详细

5.1舍罕王的失算

时间:2017-04-28 10:28:03      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:int   ace   div   ios   iostream   str   name   文件   for   

Q 直接看代码吧。再用pow()函数的时候要记住头文件#include<cmath>

 

#include  <iostream>
#include <cmath>
using namespace std;
int main() {
	double sum=0;
	for(int i=1;i<=64;i++)
		sum+=pow(2,i-1);
	
	cout<<sum;
	return 0;
}

  

5.1舍罕王的失算

标签:int   ace   div   ios   iostream   str   name   文件   for   

原文地址:http://www.cnblogs.com/dd2hm/p/6780072.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!