标题:编译出问题
取消只看楼主
hddgwxn586
Rank: 1
等 级:新手上路
帖 子:37
专家分:0
注 册:2017-5-18
结帖率:66.67%
 问题点数:0 回复次数:2 
编译出问题
#include <iostream.h>
#include <stdio.h>
#include <string.h>
  
#include <iomanip.h>  
void main()
{
double amount = 22.0/7;
cout <<amount <<endl;
cout <<setdivcision(2) <<amount <<endl;

}
-------------------Configuration: 例16-16-03 - Win32 Debug--------------------
Compiling...
例16-16-03.cpp
C:\c009\例16-16-03.cpp(11) : error C2065: 'setdivcision' : undeclared identifier
Error executing cl.exe.
例16-16-03.exe - 1 error(s), 0 warning(s)
编译时出错!问题在哪?
搜索更多相关主题的帖子: 编译 include amount cpp exe 
2017-07-07 15:01
hddgwxn586
Rank: 1
等 级:新手上路
帖 子:37
专家分:0
注 册:2017-5-18
得分:0 
回复 3楼 rjsp

这个语句编译出错
cout << fixed << setprecision(2) << amount << endl; // 改为小数点后2位,输出3.14

--------------------Configuration: 例16-16-03 - Win32 Debug--------------------
Compiling...
例16-16-03.cpp
C:\c009\例16-16-03.cpp(13) : error C2065: 'fixed' : undeclared identifier
Error executing cl.exe.

例16-16-03.exe - 1 error(s), 0 warning(s)
2017-07-07 21:00
hddgwxn586
Rank: 1
等 级:新手上路
帖 子:37
专家分:0
注 册:2017-5-18
得分:0 
回复 5楼 rjsp
对了! 谢谢!
2017-07-07 23:25



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-479246-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.394158 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved