POJ 3100 Root of the Problem || 1004 Financial Management 洪水!!!
水两发去建模,晚饭吃跟没吃似的,吃完没感觉啊。
---------------------------分割线”水过。。。。。“-------------------------------
POJ 3100 Root of the Problem
http://poj.org/problem?id=3100
大意:
给定B和N,求一个数A使得A^N最接近B
太水了。。。。。
#include<cstdio>
#include<cmath>
int main()
{
double B,N;
while(scanf("%lf%lf",&B,&N),B||N)
{
double a1=floor(pow(B,1.0/N));
double a2=a1+1; if(fabs(pow(a1,N)-B )> fabs(pow (a2,N)-B))
printf("%.0lf\n",a2);
else
printf("%.0lf\n",a1); }
}
1004 Financial Management
http://poj.org/problem?id=1004
大意:给定12个数,求他们平均值。。。。。。。。
#include<cstdio>
int main()
{
double temp,sum=0;
for(int i=0;i<12;i++)
{
scanf("%lf",&temp);
sum+=temp;
}
printf("$%.2lf\n",sum/12);
}
POJ 3100 Root of the Problem || 1004 Financial Management 洪水!!!的更多相关文章
- POJ 3100:Root of the Problem
Root of the Problem Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 12060 Accepted: 6 ...
- poj 1004:Financial Management(水题,求平均数)
Financial Management Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 126087 Accepted: ...
- [POJ] #1004# Financial Management : 浮点数运算
一. 题目 Financial Management Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 173910 Acc ...
- OpenJudge/Poj 1004 Financial Management
1.链接地址: http://poj.org/problem?id=1004 http://bailian.openjudge.cn/practice/1004 2.题目: 总时间限制: 1000ms ...
- poj 1004 Financial Management
求平均数,记得之前在杭电oj上做过一个求平均数的题目,结果因为题目是英文的,我就懵逼了 #include <stdio.h> int main() { ; double num; int ...
- [POJ 1004] Financial Management C++解题
参考:https://www.cnblogs.com/BTMaster/p/3525008.html #include <iostream> #include <cstdio> ...
- Financial Management POJ - 1004
Financial Management POJ - 1004 解题思路:水题. #include <iostream> #include <cstdio> #include ...
- POJ 1004:Financial Management
Financial Management Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 165062 Accepted: ...
- poj 3100 (zoj 2818)||ZOJ 2829 ||ZOJ 1938 (poj 2249)
水题三题: 1.给你B和N,求个整数A使得A^n最接近B 2. 输出第N个能被3或者5整除的数 3.给你整数n和k,让你求组合数c(n,k) 1.poj 3100 (zoj 2818) Root of ...
随机推荐
- vue 实例的生命周期
Vue把整个生命周期划分为创建.挂载.更新.销毁等阶段,每个阶段都会给一些"钩子"让我们来做一些我们想实现的动作. 分为以下几个阶段 1.beforeCreate 此阶段为 ...
- myBatis通过逗号分隔字符串,foreach
前言 当数据库里存储的值是以逗号分隔格式存储的字符串时. 数据格式如下: id name ids 1 张三 a,b,c 2 李四 c,d,e 我们拿到的条件参数是:b,e 1.后台通 ...
- Web开发中,使用表格来展示每个角色对应的权限
通过表格这种方式,来展示角色和权限之间的关系,挺好的.还有很多场景,都可以用这种方式. 角色权限表 权限 系统管理员 文章管理员 相册管理员 留言管理员 个人信息管理 查看个人信息 √ √ √ √ 编 ...
- C++遍历目录+_finddata_t结构体用法
Struct _finddata_t是用来存储文件各种信息的结构体,使用这个结构体要引用的头文件为“ #include <io.h>”它的结构体定义如下: struct _finddata ...
- HDU 3487(Play with Chain-Splay)[template:Splay]
Play with Chain Time Limit: 6000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- smarty模板引擎(一)基础知识
一.基本概念 1.什么是mvc? mvc是一种开发模式,核心思想是:数据的输入.数据的处理.数据显示的强制分离. 2.什么是smarty? smarty是一个php的模板引擎.更明白的 ...
- UVA 11346 Probability (几何概型, 积分)
题目链接:option=com_onlinejudge&Itemid=8&page=show_problem&problem=2321">https://uva ...
- UVa 11094 - Continents
题目:有一些岛屿在湖中.地图用两种字符表示.当前处在位置是一个岛屿.求除了当前岛屿外的最大岛屿. 分析:图论,floodfill.直接利用dfs求联通部分的面积就可以,然后取出最大. 说明:横线没有边 ...
- golang md5
package main import ( "crypto/md5" "encoding/hex" "fmt" "io" ...
- BZOJ2738: 矩阵乘法(整体二分)
Description 给你一个N*N的矩阵,不用算矩阵乘法,但是每次询问一个子矩形的第K小数. Input 第一行两个数N,Q,表示矩阵大小和询问组数: 接下来N行N列一共N*N个数,表示这个矩阵: ...