现在的位置: 首页 > 综合 > 正文

zoj 1763 A Simple Question of Chemistry

2012年10月07日 ⁄ 综合 ⁄ 共 310字 ⁄ 字号 评论关闭
#include "iostream"
#include "vector"
using namespace std;
int main()
{
	double num;
	int length;
	double ans;
	vector<double> v;
	while ( 1)
	{
		cin >> num;
		if (num == 999) break;
		v.push_back(num);
	}
	length = v.size();
	cout.setf(ios_base::fixed);
	cout.precision(2);
	for (int i = 0; i < length - 1; i++)
	{
		ans = v[i+1] - v[i];
		cout << ans << endl;
	}
	cout << "End of Output" << endl;
}

抱歉!评论已关闭.