#include <iostream.h>
#include <stdio.h>
const float UNIT_COST = 12.0;
const int DECIMAL_PLACES_OUTPUT = 2;void main()
{
  float Length;
  float Width;
  float Area;
  float Cost;  cout << "Please enter length of room: ";
  cin >> Length;
  cout << endl;
  cout << " Please enter width of room: ";
  cin >> Width;
  cout << endl;  Area=Length * Width;
  Cost=UNIT_COST * Area;cout << fixed << showpoint //问题应该就是这里两句,望指导~ 谢了
 << setprecision(DECIMAL_PLACES_OUTPUT);  cout << "Total Cost is "<< Cost;  getchar();
}

解决方案 »

  1.   

    fixed 是从哪里冒出来的?
      

  2.   

    cout << fixed << showpoint //问题应该就是这里两句,望指导~ 谢了
     << setprecision(DECIMAL_PLACES_OUTPUT);
    这句有什么用?
    fixed和showpoint都没有定义啊
      

  3.   

    fixed << showpoint //问题应该就是这里两句,望指导~ 谢了
     << setprecision(DECIMAL_PLACES_OUTPUT);
    你的fixed,showpoint都没声明啊
      

  4.   

    你们的意思就是说这两个不是现成的函数? setprtcision呢?
      

  5.   

    那就是说这里没办法改? 
    setprtcision这句呢? 怎样改》
      

  6.   

    我是初学的· 我老师要我把程序改好· 但是这个明显是...没有办法改~ 唉· 所以来问咯~ 
    另外setprtcision这个函数呢?
      

  7.   

    msdn里面有那两个东西,可惜没有说明是哪个头文件
      

  8.   

    帮帮忙啦` 我初学的~ 又没有msdn~ 谢了
      

  9.   

    改成下面少了两个错误,不过最后一个没有搞定#include <iostream.h>
    #include <stdio.h>const float UNIT_COST = 12.0;
    const int DECIMAL_PLACES_OUTPUT = 2;void main()
    {
      float Length;
      float Width;
      float Area;
      float Cost;  cout << "Please enter length of room: ";
      cin >> Length;
      cout << endl;
      cout << " Please enter width of room: ";
      cin >> Width;
      cout << endl;  Area=Length * Width;
      Cost=UNIT_COST * Area;  cout << ios::fixed << ios::showpoint //问题应该就是这里两句,望指导~ 谢了
      << setprecision(DECIMAL_PLACES_OUTPUT);  cout << "Total Cost is "<< Cost;  getchar();
    }
      

  10.   

    头文件找到拉,下面的编译通过。
    #include <iostream>
    #include <stdio.h>
    #include <iomanip>
    using namespace std;
    const float UNIT_COST = 12.0;
    const int DECIMAL_PLACES_OUTPUT = 2;void main()
    {
      float Length;
      float Width;
      float Area;
      float Cost;  cout << "Please enter length of room: ";
      cin >> Length;
      cout << endl;
      cout << " Please enter width of room: ";
      cin >> Width;
      cout << endl;  Area=Length * Width;
      Cost=UNIT_COST * Area;  cout << ios::fixed << ios::showpoint //问题应该就是这里两句,望指导~ 谢了
      << setprecision(DECIMAL_PLACES_OUTPUT);  cout << "Total Cost is "<< Cost;  getchar();
    }
      

  11.   

    总结:如果使用标准名字空间using namespace std可以不要ios::,相应的头文件为
    #include <iostream>
    #include <stdio.h>
    #include <iomanip>如果不使用标准名字空间using namespace std则必须要加ios::,相应的头文件为
    #include <iostream.h>
    #include <stdio.h>
    #include <iomanip.h>
      

  12.   

    请教bobob,请问相应的头文件怎样找?