亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

未定義標識符

代碼:

#include "iostream"

#include "stdlib.h"

#include "stdafx.h"

using namespace std;


int main()

{

cout << "請輸入一個整數:";

int x;

cin >> x;

cout << oct << x << endl;

cout << dec << x << endl;

cout << hex << x << endl;


cout << "請輸入一個布爾值(0,1):";

bool y = false;

cin >> y;

cout << boolalpha << y << endl;


system("pause");

return 0;

?}

報錯:

1>e:\project\c++\test\test\test\test.cpp(13): error C2065: “cout”: 未聲明的標識符

1>e:\project\c++\test\test\test\test.cpp(13): error C2065: “hex”: 未聲明的標識符

1>e:\project\c++\test\test\test\test.cpp(13): error C2065: “endl”: 未聲明的標識符

1>e:\project\c++\test\test\test\test.cpp(15): error C2065: “cout”: 未聲明的標識符

1>e:\project\c++\test\test\test\test.cpp(17): error C2065: “cin”: 未聲明的標識符

1>e:\project\c++\test\test\test\test.cpp(17): warning C4804: “>>”: 在操作中使用類型“bool”不安全

1>e:\project\c++\test\test\test\test.cpp(18): error C2065: “cout”: 未聲明的標識符

1>e:\project\c++\test\test\test\test.cpp(18): error C2065: “boolalpha”: 未聲明的標識符

1>e:\project\c++\test\test\test\test.cpp(18): error C2065: “endl”: 未聲明的標識符

1>e:\project\c++\test\test\test\test.cpp(20): error C3861: “system”: 找不到標識符



剛開始求解答,謝謝。


正在回答

1 回答

https://img1.sycdn.imooc.com//5ac2d9b90001b72a03960144.jpg這樣子就好了


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
C++遠征之起航篇
  • 參與學習       290962    人
  • 解答問題       817    個

C++亮點盡在其中,本課程是在C語言基礎上的一個延伸,得以升華

進入課程

未定義標識符

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號