ZOJ 1242 Carbon Dating
2024-08-31 19:14:39
UVA昨天上不去,今天一大早起来还是上不去 0.0
于是去ZOJ
这题大意就是半衰期。。。
取对数用到了换底公式。。。我都忘了这玩意了T T
上代码。。。
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
double w ,d,n;
int count=1;
while(cin>>w>>d,w||d)
{
d/=w;
n=5730*log(d/810)/log(0.5);
if(n<10000)
n=int (n+50)/100*100;
else
n=int (n+500)/1000*1000;
cout<<"Sample #"<<count++<<endl<<"The approximate age is "<<n<<" years."<<endl<<endl;
}
return 0;
}
最新文章
- Nova PhoneGap框架 第一章 前言
- 解决Winform应用程序中窗体背景闪烁的问题
- Tomcat无法启动问题
- c#访问http接口的";编码";问题
- Docker on CentOS for beginners
- Python 字典和列表的对比应用
- 【POJ】【2420】A Star not a Tree?
- 【iOS开发】iOS7 兼容及部分细节
- 代码bug
- [php基础]PHP.INI配置:Session配置详细说明教程
- 超链接解决头部fixed问题
- 多工程:基于Maven的SSM(Spring,SpringMvc,Mybatis)整合的web工程(中)
- 面试(2)-java-se-HashSet和TreeSet
- bzoj 2298: [HAOI2011]problem a
- 第12章 X.509证书库的Fluent API - IdentityModel 中文文档(v1.0.0)
- 设置RHEL-7.0的运行级别
- python中TCP粘包问题解决方案
- css居中方法小结
- Android动画知识汇总
- 高性能缓存服务器Varnish