博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
poj2871 A Simple Question of Chemistry
阅读量:2440 次
发布时间:2019-05-10

本文共 2093 字,大约阅读时间需要 6 分钟。

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

Sample Output

2.0518.20-10.25End of Output

水!!!

参考代码:

#include
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;}

转载地址:http://lfbqb.baihongyu.com/

你可能感兴趣的文章
深入理解硬盘的Linux分区(转)
查看>>
循序渐进教你LINUX之软件配置方法(转)
查看>>
NetBSD 指导手册(转)
查看>>
打造FreeBSD桌面系统(2)(转)
查看>>
为你的 Windows 98 加把锁(转)
查看>>
Windows 98 资源管理(转)
查看>>
认识 Windows 98 备份(转)
查看>>
Windows 98 禁止注册表检查器自动运行(转)
查看>>
Windows 98 注册表大修改(转)
查看>>
Windows 98 给回收站右键菜单增加重命名命令(转)
查看>>
科学的清理 Windows 98 注册表(转)
查看>>
Windows 98 桌面主题和用户管理(转)
查看>>
Windows 98 注册表妙用(转)
查看>>
自行添加欢迎对话框中的文本(转)
查看>>
Win2K Terminal Service使用经验(转)
查看>>
Windows 98 注册表应用的30个实例(转)
查看>>
为 Windows 98 的注册表数据库减肥(转)
查看>>
同时最小化多个Windows窗口(转)
查看>>
Windows Vista 内建管理员帐号被禁用(转)
查看>>
Geforce 4 MX 440强制Vista 开启玻璃效果(转)
查看>>