hdoj 1178 Heritage from father (数学题)
来源:互联网 发布:linux使用gdb 编辑:程序博客网 时间:2024/06/06 04:57
思路:1+6+.....+i(i+1)/2=i*(i+1)*(i+2);
代码如下:
#include <iostream> #include <stdio.h>#include <stdlib.h>#include <string.h>#include <math.h>#include <algorithm>#include <vector>using namespace std;int main(){int n;int i;double sum;int a;while(scanf("%d",&n) && n){sum=n;sum=sum*(sum+1)/6.0*(sum+2);a=log10(sum);sum=sum/pow(10,a);printf("%.2fE%d\n",sum,a);} return 0; }
阅读全文
0 0
- hdoj 1178 Heritage from father (数学题)
- hdu1178数学题 Heritage from father
- hdoj-1178-Heritage from father【科学计数法表示】
- 1178 hdu Heritage from father
- hdu 1178 Heritage from father
- HDU 1178 Heritage from father
- HDU 1178 Heritage from father
- HDU 1178Heritage from father
- HDU 1178 Heritage from father
- hdu---1178Heritage from father
- hdu(1178)Heritage from father
- HDU 1178 Heritage from father 数学公式 JAVA
- Heritage from father
- Heritage from father
- Heritage from father
- Heritage from father
- HDU Heritage from father
- 杭电 - Heritage from father
- 模板方法模式浅析
- MapReduce 练习三 文件倒排
- VB操作xml的简单例子
- screen命令详解 linux中的"远程神器"
- 简单的二级购物车
- hdoj 1178 Heritage from father (数学题)
- 重新对DataTable排序
- Spark一些配置参数整理
- Github使用入门
- ajax提交form表单
- UVA
- day 42 Apache认证及常见功能
- SQL INSERT INTO 语句
- OLAP分类的基本概念和基本操作