水两发去建模,晚饭吃跟没吃似的,吃完没感觉啊。

---------------------------分割线”水过。。。。。“-------------------------------

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 洪水!!!的更多相关文章

  1. POJ 3100:Root of the Problem

    Root of the Problem Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 12060   Accepted: 6 ...

  2. poj 1004:Financial Management(水题,求平均数)

    Financial Management Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 126087   Accepted: ...

  3. [POJ] #1004# Financial Management : 浮点数运算

    一. 题目 Financial Management Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 173910   Acc ...

  4. OpenJudge/Poj 1004 Financial Management

    1.链接地址: http://poj.org/problem?id=1004 http://bailian.openjudge.cn/practice/1004 2.题目: 总时间限制: 1000ms ...

  5. poj 1004 Financial Management

    求平均数,记得之前在杭电oj上做过一个求平均数的题目,结果因为题目是英文的,我就懵逼了 #include <stdio.h> int main() { ; double num; int ...

  6. [POJ 1004] Financial Management C++解题

    参考:https://www.cnblogs.com/BTMaster/p/3525008.html #include <iostream> #include <cstdio> ...

  7. Financial Management POJ - 1004

    Financial Management POJ - 1004 解题思路:水题. #include <iostream> #include <cstdio> #include ...

  8. POJ 1004:Financial Management

    Financial Management Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 165062   Accepted: ...

  9. 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 ...

随机推荐

  1. 【Django】实现跨域请求

    目录 JsonP实现跨域 在Django中间件中添加响应头 @ *** CORS 即 Cross Origin Resource Sharing 跨域资源共享. 跨域请求分两种:简单请求.复杂请求. ...

  2. DataGridView控件绑定数据源

    前言: 近期听说DataGridView控件能直接绑定数据源.而不用穿越这层那层的忍辱负重.获取数据.真是高兴的屁颠屁颠的.后来一想二狗肯定不会弄.特意写了一个笨蛋版的教程--也算记录生活.欢度端午了 ...

  3. JDBC连接池C3P0

    连接池 1)传统方式找DriverManager要连接.数目是有限的. 2)传统方式的close().并没有将Connection重用.仅仅是切断应用程序和数据库的桥梁,即无发送到SQL命令到数据库端 ...

  4. vim-录制命令的使用

    使用vim时无意间触碰到q键,左下角出现“recording”这个标识,这是vim的一个强大功能. 他可以录 制一个宏(Macro),在开始记录后,会记录你所有的键盘输入,包括在insert模式下的输 ...

  5. 16.REPL 命令

    转自:http://www.runoob.com/nodejs/nodejs-tutorial.html ctrl + c - 退出当前终端. ctrl + c 按下两次 - 退出 Node REPL ...

  6. Logstash整合Elasticsearch

    1:启动Elasticsearch2:bin/logstash -e 'input { stdin { } } output { elasticsearch { host => localhos ...

  7. 20款PHP版WebMail开源项目

    20款PHP版WebMail开源项目 如今互联网巨头提供的企业应用套件中邮件托管是必备服务,而且还始终秉承免费的优良光荣传统,最为让人熟识的恐怕非"瘟多死里屋管理中心"和" ...

  8. <%%>创建内联代码块(表达式)

    其实<%%>很早之前就见过了,只是会用一点功能,其它的不甚了解.今天偶尔见到了它的庐山真面目,现在共享给大家. 语法 代码块呈现(<%%>)定义了当呈现页时执行的内联代码或内联 ...

  9. 1.14 Python基础知识 - 文件操作

    应用程序往往需要从磁盘文件中读取数据,或者把数据存储到磁盘中文件里,以持久的保存数据.文件可以看作是数据的集合,文件的输入与输出通过流来实现.流有5种基本的操作:打开.读取.写入.改变当前位置和关闭. ...

  10. 用Promise对象封装JQuery的AJAX过程

    let jqPostAjaxPromise = function(param){ return new Promise(function(resolve, reject){ $.ajax({ url: ...