POJ 2871 A Simple Question of Chemistry(水题)

【题意简述】:后一个数减去前一个数并输出。

【分析】:水

//208K 16Ms
#include<iostream>
using namespace std;

int main()
{
	double a;
	double b;
	bool flag = false;
	double ans;
	while(cin>>a)
	{
		if(a==999)
		{
			cout<<"End of Output"<<endl;
			break;
		}
		if(!flag)
		{
			b = a;
			flag = true;
		}
		else
		{
			ans = a-b;
			b = a;
			printf("%.2f\n",ans);
		}

	}
	return 0;
}
时间: 2024-10-09 11:55:31

POJ 2871 A Simple Question of Chemistry(水题)的相关文章

poj2871 A Simple Question of Chemistry

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 Che

zoj 1763 A Simple Question of Chemistry

A Simple Question of Chemistry Time Limit: 2 Seconds      Memory Limit: 65536 KB Your chemistry lab instructor is a very enthusiastic graduate student who clearly has forgotten what their undergraduate Chemistry 101 lab experience was like. Your inst

HDU 4143 A Simple Problem(数论-水题)

A Simple Problem Problem Description For a given positive integer n, please find the smallest positive integer x that we can find an integer y such that y^2 = n +x^2. Input The first line is an integer T, which is the the number of cases. Then T line

poj 1164 The Castle dp区域计数水题

水题,直接贴代码. //poj 1164 //sep9 #include <iostream> using namespace std; int a[64][64]; int dp[64][64]; int n,m; const int west=1,north=2,east=4,south=8; void dfs(int x,int y) { dp[x][y]=1; if((a[x][y]&north)==0&&dp[x-1][y]==-1){ dfs(x-1,y);

POJ 2239--Selecting Courses【二分图 &amp;&amp; 最大匹配数 &amp;&amp; 水题】

Selecting Courses Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9363   Accepted: 4164 Description It is well known that it is not easy to select courses in the college, for there is usually conflict among the time of the courses. Li Mi

POJ 2739 Sum of Consecutive Prime Numbers(水题)

Sum of Consecutive Prime Numbers Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 20560   Accepted: 11243 Description Some positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representatio

POJ 3325 ICPC Score Totalizer Software(水题)

[题意简述]:去掉一个最高分,去掉一个最低分,求平均分. [分析]:此题和POJ3507其实质是一样的. //732K 32Ms #include<iostream> #include<cmath> #include<algorithm> using namespace std; int score[101];//成绩 int main() { int t; int sum; while(1) { sum = 0; cin>>t; if(t == 0) br

POJ 3224 Go for Lab Cup!(水题)

[题意简述]:扫描矩阵,哪一行的'3'多,谁就是胜者,可以取参赛. [分析]:题意里已经说了. //260K 0Ms #include<iostream> using namespace std; int main() { int matrix[100][100]; int a[100]; int n; cin>>n; for(int i = 1;i<=n;i++) for(int j = 1;j<=n;j++) cin>>matrix[i][j]; int

poj 1979 Red and Black(dfs水题)

Description There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can't move on red tiles, he can move only