poj 2871 A Simple Question of Chemistry

//注意输入的格式即可! 
#include <iostream>
#include <cstdio>
using namespace std;

int main()
{
    double num1, num2, ans;
    bool flag = false;
    while (1){
          if (!flag){
              cin >> num1;
              flag = true;
          }
          if (num1 == 999)  break;
          cin >> num2;
          ans = num2 - num1;
          num1 = num2;
          if (num1 == 999)  break;
          printf("%.2lf\n", ans);
    }
    cout << "End of Output" << endl;
    system("pause");
}

你可能感兴趣的:(System,output)