2011-05-28 82 views
4

我的Xcode會編譯,但不會讓我輸入什麼Xcode不接受用戶輸入!

#include <iostream> 
using namespace std; 

bool truthStatement; 
int main (int argc, const char * argv[]) 
{ 
    string name; 
    cout << "What is your name?" << endl; 
    cin >> name; 
    if (name == "Matt"){ 
     cout << "You're cool" << endl; 

    } else { 
     cout << "You suck" << endl; 
    } 

} 
+0

這仍然是你的問題嗎?剛剛在XCode中嘗試過一個測試項目。似乎工作正常。 – 2011-09-02 14:49:51

+0

您的問題是否已解決? – 2011-12-03 02:17:40

回答

0

我以前也有這個問題。確保您使用的是Return鍵而不是鍵盤上的Enter鍵。