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 ...
随机推荐
- 免费超大量邮件发送服务Amazon SES和Mailgun提供SMTP和API支持
一般来说网站注册.论坛消息.新闻推送.广告宣传等都会有发送邮件服务,大量的邮件发送服务如果用PHP来发送,一是会消耗主机资源,二是容易被各大邮箱判定为垃圾邮件而被拒收.用第三方的邮局服务发送邮件,可以 ...
- JDBC连接池C3P0
连接池 1)传统方式找DriverManager要连接.数目是有限的. 2)传统方式的close().并没有将Connection重用.仅仅是切断应用程序和数据库的桥梁,即无发送到SQL命令到数据库端 ...
- UML中的用例图
用例图构成:參与者(actor).用例(use case).子系统(subsystem) 关联(Association) 泛化(Inheritance) 就是通常理解的继承关系,子用例和父用例类似,但 ...
- 【原创】k8s源代码分析-----EndpointController
转自本人空间 http://user.qzone.qq.com/29185807/blog/1459325937 一.controller manager创建endpointController 代码 ...
- CSS布局篇——固宽、变宽、固宽+变宽
学了前端挺久了.近期写一个项目測试系统,布局时发现自己对变宽+固宽的布局还没有全然掌握,所以在这里总结一下,以后须要的时候回头看看. 1.最简单的当然是一列或多列固宽 比如两列固宽: <1> ...
- scrollBarStyle- listview滑动条调整
今天在解决问题的时候,需要设置listview滚动条,使listview的内容不能被滚动条覆盖 后来发现网上提到一个 ScrollView 属性.ScrollView中ScrollBar的style ...
- c#的中英文混合字符串截取
public class StringHelper { public static string GetSubString(string str, int len) ...
- BZOJ2716: [Violet 3]天使玩偶(KD-Tree)
Description Input Output Sample Input 100 100 81 23 27 16 52 58 44 24 25 95 34 2 96 25 8 14 97 50 97 ...
- 强连通分量分解 Kosaraju算法 (poj 2186 Popular Cows)
poj 2186 Popular Cows 题意: 有N头牛, 给出M对关系, 如(1,2)代表1欢迎2, 关系是单向的且能够传递, 即1欢迎2不代表2欢迎1, 可是假设2也欢迎3那么1也欢迎3. 求 ...
- Scala入门到精通——第二十九节 Scala数据库编程
本节主要内容 Scala Mavenproject的创建 Scala JDBC方式訪问MySQL Slick简单介绍 Slick数据库编程实战 SQL与Slick相互转换 本课程在多数内容是在官方教程 ...