用c++向计算机输入数据
当缓冲区为空时,程序才会暂停,让用户输入数据.
输入回车后,数据全部送到输入缓冲区。
#include
#include<Windows.h>
using namespace std;
int main(void){
char girlType;
int salary;
float height;
cout<<"请输入您的理想类型:\n a:贤惠型 \n b:泼辣型 \n c:文艺型\n d:运动型"<<endl;
cin>>girlType;
cout<<"请输入您的月收入"<<endl;
cin>>salary;
cout<<"请输入您的身高【单位-米】"<<endl;
cin>>height;
cout<<"您的理想型为:"<<girlType<<endl;
cout<<"您的月收入为:"<<salary<<"元"<<endl;
cout<<"您的身高为"<<height<<"米"<<endl;
system("pause");
return 0;
}