POJ 2871 A Simple Question of Chemistry(水~)
来源:互联网 发布:鹊桥淘客群助手软件 编辑:程序博客网 时间:2024/05/20 06:39
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
Solution
Code
#include<stdio.h>int main(){ float n,nn; scanf("%f",&n); nn=n; while(1) { scanf("%f",&n); if((int)n==999) { printf("End of Output\n"); return 0; } else { printf("%.2f\n",n-nn); nn=n; } }}
0 0
- POJ 2871 A Simple Question of Chemistry(水~)
- poj 2871 A Simple Question of Chemistry
- poj 2871 A Simple Question of Chemistry
- poj 2871 A Simple Question of Chemistry
- POJ 2871 A Simple Question of Chemistry(水题)
- POJ 2871 A Simple Question of Chemistry G++
- zoj 1763 A Simple Question of Chemistry(洪水!)
- poj2871 A Simple Question of Chemistry(水题)
- zoj 1763 A Simple Question of Chemistry
- zoj 1763 A Simple Question of Chemistry
- zoj1763-----------A Simple Question of Chemistry
- ZOJ 1763 A Simple Question of Chemistry
- zoj 1763.A Simple Question of Chemistry
- zoj 1763 A Simple Question of Chemistry
- 1763 A Simple Question of Chemistry
- poj2871 A Simple Question of Chemistry
- POJ 2871 A Simple Question of Chemistry(我的水题之路——数列两数之差 )
- ZOJ 1763: A Simple Question of Chemistry 【位数问题setprecision】
- 黑马程序员-类的封装,继承和多态
- BZOJ 2125 最短路.
- 包管理器bower
- OrderedStatic
- python 处理时间
- POJ 2871 A Simple Question of Chemistry(水~)
- java 按行读取文件
- sublime 使用
- Mac 安装配置Mysql
- OC学习笔记(2)-protocal
- Extjs静态树
- 欢迎使用CSDN-markdown编辑器
- swift 拼图小游戏
- JAVA连接mysql数据库常用功能框架。