首页 > 代码库 > POJ 2871 A Simple Question of Chemistry(水题)

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



POJ 2871 A Simple Question of Chemistry(水题)