[英]Running qt terminal for windows 7
我的程序(下面)可以編譯,但是不允許我輸入值。 我看過許多線程,它們要求單擊運行中的接線盒,但這只會彈出一個窗口,指出“按此關閉窗口”,這實際上是違背了目的。 任何幫助都會很棒。 謝謝
#include <QCoreApplication>
#include <QTextStream>
//using namespace std;
QTextStream cin(stdin);
QTextStream cout(stdout);
int main()
{
QString firstName;
QString lastName;
QString houseNumber;
QString streetName;
QString streetType;
QString city;
QString state;
QString zipCode;
QString phone;
cout<<"Please enter your first name: " << endl;
cin >> firstName;
cout << endl <<"Please enter your first name: " << endl;
cin >> lastName;
cout << endl <<"Please enter your house number: " << endl;
cin >> houseNumber;
cout << endl <<"Please enter your street Name: " << endl;
cin >> streetName;
cout << endl <<"Please enter your street type (i.e. Rd, St, Blvd, ect): ";
cin >> streetType;
cout << endl <<"Please enter your city: " << endl;
cin >> city;
cout << endl <<"Please enter your state: " << endl;
cin >> state;
cout << endl <<"Please enter your zip code: " << endl;
cin >> zipCode;
cout << endl <<"Please enter your phone number: " << endl;
cin >> phone;
cout << endl << "Your information is: " << endl << endl;
cout << firstName <<" "<<lastName<<endl;
cout << houseNumber << " " << streetName << " " << streetType << endl;
cout << city << ", " << state << " " << zipCode << endl;
cout << "Phone Number: " << phone << endl << endl;
return 0;
}
如果需要使用終端運行程序,請在此處解決: Qt Creator的控制台輸入
至少對我有用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.