您的位置:首页 > 产品设计 > UI/UE

zoj 1763 A Simple Question of Chemistry(洪水!)

2010-07-21 15:27 459 查看
输出后一个数减前一个数,精确到小数点后两位,遇到999输入结束。。



叙述得真够麻烦的!就当锻炼英语吧~



学习了下c++中输出格式问题。比C复杂好多啊。。



我把那文章贴过来得啦~







额。。这题我的代码。。



#include <iostream>
#include <iomanip>
using namespace std;
int main(void)
{
    double x,y,temp;
    cin>>x;
    while(cin>>y && y!=999)
    {
        cout<<fixed << setprecision(2) << (y-x)<<endl;
        temp = x;
        x = y;
        y = temp;
    }
    cout<<"End of Output";
system("pause");
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: