| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 607 人关注过本帖
标题:简单的C++头文件问题~
取消只看楼主 加入收藏
小小小小小黄
Rank: 1
等 级:新手上路
帖 子:28
专家分:4
注 册:2012-12-10
结帖率:44.44%
收藏
已结贴  问题点数:20 回复次数:5 
简单的C++头文件问题~
cout<<setw(8)<<left<<a
这里面left的头文件是什么?

C:\Documents and Settings\小黄黄黄黄黄\桌面\C++程序题\ex4.cpp(9) : error C2065: 'left' : undeclared identifier
上面是编译提示的错误~
目的是让输出的数据靠左整齐~

2013-01-18 11:32
小小小小小黄
Rank: 1
等 级:新手上路
帖 子:28
专家分:4
注 册:2012-12-10
收藏
得分:0 
回复 楼主 小小小小小黄
//斐波那契数列。输出斐波那契数列的前40项。
//斐波那契数列数列的特征是:前两项为1,以后每一项为前两项只和。
#include<iostream.h>
#include<iomanip.h>

void main()
{
    int a=1,b=1,c;
    cout<<setw(8)<<left<<a
        <<setw(8)<<left<<b;
    for(int i=1;i<=38;i++)
    {
        c=a+b;
        a=b;
        b=c;
        cout<<setw(8)<<left<<c;
    }
}


编译时的错误:
c:\documents and settings\小黄黄黄黄黄\桌面\c++程序题\ex4.cpp(9) : error C2065: 'left' : undeclared identifier
Error executing cl.exe.
2013-01-18 22:16
小小小小小黄
Rank: 1
等 级:新手上路
帖 子:28
专家分:4
注 册:2012-12-10
收藏
得分:0 
回复 3楼 羽VS翼
//斐波那契数列。输出斐波那契数列的前40项。
//斐波那契数列数列的特征是:前两项为1,以后每一项为前两项只和。
#include<iostream.h>
#include<iomanip.h>

void main()
{
    int a=1,b=1,c;
    cout<<setw(8)<<left<<a
        <<setw(8)<<left<<b;
    for(int i=1;i<=38;i++)
    {
        c=a+b;
        a=b;
        b=c;
        cout<<setw(8)<<left<<c;
    }
}


编译时的错误:
c:\documents and settings\小黄黄黄黄黄\桌面\c++程序题\ex4.cpp(9) : error C2065: 'left' : undeclared identifier
Error executing cl.exe.
2013-01-18 22:17
小小小小小黄
Rank: 1
等 级:新手上路
帖 子:28
专家分:4
注 册:2012-12-10
收藏
得分:0 
回复 2楼 qunxingw
//斐波那契数列。输出斐波那契数列的前40项。
//斐波那契数列数列的特征是:前两项为1,以后每一项为前两项只和。
#include<iostream.h>
#include<iomanip.h>

void main()
{
    int a=1,b=1,c;
    cout<<setw(8)<<left<<a
        <<setw(8)<<left<<b;
    for(int i=1;i<=38;i++)
    {
        c=a+b;
        a=b;
        b=c;
        cout<<setw(8)<<left<<c;
    }
}


编译时的错误:
c:\documents and settings\小黄黄黄黄黄\桌面\c++程序题\ex4.cpp(9) : error C2065: 'left' : undeclared identifier
Error executing cl.exe.
2013-01-18 22:17
小小小小小黄
Rank: 1
等 级:新手上路
帖 子:28
专家分:4
注 册:2012-12-10
收藏
得分:0 
之前考试的时候用到了left 左对齐,头文件也是打出了iomanip.h
现在又出现问题了,小白求教~~

2013-01-18 22:18
小小小小小黄
Rank: 1
等 级:新手上路
帖 子:28
专家分:4
注 册:2012-12-10
收藏
得分:0 
回复 8楼 wp231957
求解释~
为什么~

2013-01-19 20:16
快速回复:简单的C++头文件问题~
数据加载中...
 
   



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

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