S2_输入数据基本

注意:

当缓冲区为空时,程序才会停止,让用户输入数据

输入回车后,数据全部送到输入缓冲区

 

 

 1 #include<iostream>
 2 #include<Windows.h>
 3 int main(void){
 4     char girlType;
 5     int salary;
 6     float height;
 7     
 8     std::cout << "请输入您的理想类型:\n A:贤惠型 \n B:泼辣新 \n C: 文艺型 \n D:运动型" << std::endl;
 9     std::cin >> girlType;
10     
11     std::cout << "请输入您的月收入:" << std::endl;
12     std::cin >> salary;
13     
14     std::cout << "请输入您的身高:[单位-米]" << std::endl;
15     std::cin >> height;
16     
17     std::cout << "您的理想类型是: " << girlType << std::endl;
18     std::cout << "您的月收入是: " << salary << "" << std::endl;
19     std::cout << "您的身高是: " << height << "" << std::endl;
20 
21     system("pause");
22     return 0;
23 }

 

执行结果

posted @ 2019-12-30 15:46  Lvcunda  阅读(158)  评论(0)    收藏  举报