主题:c++输入数据后按回车,怎么窗口就消失了?
初学c++,编了一个简单的程序:
#include <iostream>
int main()
{
using namespace std;
int books; // declares variable "books"
cout << "how many books do you have?" << endl; // displays the first line
cin >> books; // input a number
cout << "here are 100 more." << endl; // displays the second line
books=books+100; // adds 100 to the variable "books"
cout << "now you have " << books << " books." << endl;
//displays the third line with the changed variable "books"
cin.get();
return 0;
}
窗口出现后显示第一行文字:
how many books do you have?
随便输入一个数字,按回车,窗口就不见了。怎么办啊?
顺便说一下:IDE是Dev C++,操作系统是Windows XP SP2
#include <iostream>
int main()
{
using namespace std;
int books; // declares variable "books"
cout << "how many books do you have?" << endl; // displays the first line
cin >> books; // input a number
cout << "here are 100 more." << endl; // displays the second line
books=books+100; // adds 100 to the variable "books"
cout << "now you have " << books << " books." << endl;
//displays the third line with the changed variable "books"
cin.get();
return 0;
}
窗口出现后显示第一行文字:
how many books do you have?
随便输入一个数字,按回车,窗口就不见了。怎么办啊?
顺便说一下:IDE是Dev C++,操作系统是Windows XP SP2