poj2871 A Simple Question of Chemistry

2.13 A Simple Question of Chemistry(一个简单的化学问题)                       2.13 A Simple Question of Chemistry  2.13.1 时空限制          Time limit: 1 Seconds Memory limit: 32768K  2.13.2 题目内容          Your chemistry lab instructor is a very enthusiasti... 阅读详情

A Simple Question of Chemistry
Time Limit: 1000MS Memory Limit: 65536K
Total Submissions: 6666 Accepted: 4426

Description

Your chemistry lab instructor is a very enthusiastic graduate student who clearly has forgotten what their undergraduate Chemistry 101 lab experience was like. Your instructor has come up with the brilliant idea that you will monitor the temperature of your mixture every minute for the entire lab. You will then plot the rate of change for the entire duration of the lab. 

Being a promising computer scientist, you know you can automate part of this procedure, so you are writing a program you can run on your laptop during chemistry labs. (Laptops are only occasionally dissolved by the chemicals used in such labs.) You will write a program that will let you enter in each temperature as you observe it. The program will then calculate the difference between this temperature and the previous one, and print out the difference. Then you can feed this input into a simple graphing program and finish your plot before you leave the chemistry lab. 

Input

The input is a series of temperatures, one per line, ranging from -10 to 200. The temperatures may be specified up to two decimal places. After the final observation, the number 999 will indicate the end of the input data stream. All data sets will have at least two temperature observations. 

Output

Your program should output a series of differences between each temperature and the previous temperature. There is one fewer difference observed than the number of temperature observations (output nothing for the first temperature). Differences are always output to two decimal points, with no leading zeroes (except for the ones place for a number less than 1, such as 0.01) or spaces. After the final output, print a line with "End of Output". 

Sample Input

10.0
12.05
30.25
20
999

Sample Output

2.05
18.20
-10.25
End of Output

水!!!

参考代码:

#include<stdio.h>
int main()
{
    double n,n1;
 scanf("%lf",&n);
 while(n!=999)
 {
  scanf("%lf",&n1);
  if(n1!=999)
   printf("%.2f\n",n1-n);
  
   n=n1;
  
 }
 printf("End of Output\n");
 return 0;
}



Open3D 可视化(1)——简单可视化【2026最新版】 简单可视化,博客长期更新,本文最新更新时间为:2026年5月10日。 阅读详情

相关推荐

OASIS协议标准文档的解读_第一部分

OASIS标准协议的文档的解读。完整原协议的中文翻译和解读。

洋葱的专栏 4902

poj 2871 A Simple Question of Chemistry

A Simple Question of Chemistry Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5583 Accepted: 3707 Description Your chemistry lab instructor is a very enthus...

weixin_30900589的博客 188

系统设计---算法与架构

这片文章对系统设计的具体步骤及相关知识进行介绍,主要分为四部分:算法设计、IC系统架构设计、基于systemC的IC系统设计、系统设计工具SPW简介。 (一)算法设计 系统设计的第一步是给出清晰的系统规范,该规范写明了系统的功能、性能、费用、开发时间等。接下来创建一个系统行为模型,并且可以用来初步验证设计的性能。再下来,对行为模型进行细化,即进行算法设计。算法设计大致分为三步: 1)给出浮点

正在努力的ICer的博客 4372

POJ 2871 A Simple Question of Chemistry(我的水题之路——数列两数之差 )

A Simple Question of Chemistry Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5647   Accepted: 3757 Description Your chemistry lab instructor is a very en

938

湿敏电阻HR202的两种驱动方案实测:IO充放电法 vs. 交流方波ADC法,哪个更适合你?

本文深入评测湿敏电阻HR202的两种驱动方案:IO充放电法和交流方波ADC法。通过原理图分析、精度实测和资源占用对比,揭示交流方波ADC法在精度和稳定性上的优势,特别适合长期监测场景。同时提供IO充放电法在资源受限情况下的应用建议,帮助工程师根据项目需求做出最优选择。

weixin_30421809的博客 466

【从零开始玩量化7】easyTrader: 自动化(程序化)交易利器

前面的文章,我们介绍了数据获取工具AKShare, 量化回测工具backtrader等,这一篇,介绍程序化交易工具easyTrader。作者网名食灯鬼,目前项目在Github上的star数已经有6.7k。这可能是目前,开源能找到的,最好用的程序化交易库了。本文介绍了easyTrader的简单用法,这个包还有很多功能,后续再继续写文章探究。

量化投资助手的博客 1万+

zoj1763-----------A Simple Question of Chemistry

Your chemistry lab instructor is a very enthusiastic graduate student who clearly has forgotten what their undergraduate Chemistry 101 lab experience was like. Your instructor has come up with the bri

Life is Float. 528

VI恒流源原理详细分析(0~10V转0/4~20mA)

但是此电阻也不能无限增加,首先我们所列方程均是基于运放虚短虚断的假设,此假设又是基于运放输入阻抗无穷大,输出阻抗无穷小的前提条件,然而实际的运放并非理想运放,对于TL082IDR这款运放,其Rid(Common-mode input resistance)典型值为1TΩ,以此来看感觉1MΩ确实还不是很大,但是还有另一个影响因素需要考虑,那就是电路的抗干扰能力,原则上,电阻越大受到外部干扰的可能性越大。也就是实现Uin 0~10V变化时对应Iout 0~20mA的一个线性对应关系。

IOTBOT的博客 2898

poj2871 A Simple Question of Chemistry(水题)

Your chemistry lab instructor is a very enthusiastic graduate student who clearly has forgotten what their undergraduate Chemistry 101 lab experience was like. Your instructor has come up with the bril

1027

解密Whisper模型与Speaker Diarization的结合

本文介绍了如何将Whisper语音识别模型与Speaker Diarization(说话人分割)技术相结合,实现多人对话场景下的语音转录和说话人识别。文章详细讲解了技术背景、环境配置和代码实现方法,通过Pyannote进行说话人分割,结合Whisper进行语音转文本,最终输出包含说话人信息的完整转录结果。该解决方案适用于会议记录、访谈分析等场景,显著提升了语音处理的应用价值。

2501_90323865的博客 152

Darknet-Yolov3 移植过程

本教程面向使用寒武纪平台进行深度学习推理任务的开发者。针对当前主流检测网络darknet-yolov3,进行寒武纪平台的移植。开发者对照移植过程,能够利用寒武纪智能处理器设备完成多种场景的目标检测任务。本实验代码基于 Neuware 1.6.1 与 Python 2.7 环境。

shengyin714959的博客 438

POJ 2871 A Simple Question of Chemistry G++

#include using namespace std; int main() { double a[1000]; int n=0; while(1) { cin>>a[n]; if(a[n]==999) { break; } n++; } for(int i=0;i<n-1;i++) { cout.setf(ios_base::fixed,ios_

woniupengpeng的专栏 349

【AUTOSAR-DEM】-2.4-APP SWC如何读取MIL灯状态以及配置MIL灯

该篇博文将告诉您: MIL(Malfunction Indicator Lamp/Light)灯的点灯和灭灯过程; DEM模块如何配置MIL灯; APP SWC如何获取MIL灯状态。

「汽车电子助手」的博客 1710

POJ 2871 A Simple Question of Chemistry(水题)

【题意简述】:后一个数减去前一个数并输出。 【分析】:水 //208K 16Ms #include using namespace std; int main() { double a; double b; bool flag = false; double ans; while(cin>>a) { if(a==999) { cout<<"End of Output

坚持 718

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

POJ 2871 A Simple Question of Chemistry(水~)

Description 给出一个数列,依次输出相邻两数的差值 Input 数列长度未知,每行一个浮点数,以999结束输入 Output 输出相邻两个数的差值,以End of Output结束输出 Sample Input 10.0 12.05 30.25 20 999 Sample Output 2.05 18.20 -10.25 End of Output So

ZSQ 573

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

POJ-2871

题目分析: 1. 求两次实验的温度差值; 2.以保留两位小数的形式输出; 解题思路: 水题; 解题代码: #include #include using namespace std; int main(int argc, char *argv[]){ float preTemp=-1; float curTemp; while(cin>>curTemp,curT

eddy_liu的专栏 358

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

poj 2871

大水#include <iostream> #define eps 1e-8using namespace std;int main() { //freopen("input.txt", "r", stdin); double n,m; cin>>n; while( cin>>m ) { //if( m == 999 ) if( 999-

This is bill的专属博客 1243

zoj 1763 A Simple Question of Chemistry(洪水!)

<br />输出后一个数减前一个数,精确到小数点后两位,遇到999输入结束。。<br /> <br />叙述得真够麻烦的!就当锻炼英语吧~<br /> <br />学习了下c++中输出格式问题。比C复杂好多啊。。<br /> <br />我把那文章贴过来得啦~<br /> <br /> <br /> <br />额。。这题我的代码。。<br /> <br />#include <iostream> #include <iomanip> using namespace std; int main(voi

小媛在努力~ 969

POJ 2553-题意很重要...

看是题目看错了...以为和上一个找大牛的一样...样例正好也符合..结果WA了N次...中间也有犯的一些小错误...总是不细心...    题意是说求这些点:自己能到达的点一定能到达自己...抽象来看..就是求出各个强连通分量...这些强连通分量中没有出度的..里面所有点是解.

zzyzzy12 1390
上一篇: poj2864 Pascal Library
下一篇: poj2845 01000001
JinbaoSite0144
博客等级 码龄12年 231粉丝 157原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值