首页 > 其他 > 详细

cin.get()让程序可连续输入

时间:2015-09-03 09:13:29      阅读:309      评论:0      收藏:0      [点我收藏+]

#include "stdafx.h" #include <iostream>

int main()

{  

using namespace std;

 int carrots;

 cout<< "How many carrots do you have?"<<endl;  cin>>carrots;  

cout<<"Here are two more";  carrots=carrots+2;  

cout<<"Now you have "<<carrots<<" carrots."<<endl;

 cin.get();//  

cin.get();//加上两条才能在屏幕上显示

 return 0; }

cin.get()让程序可连续输入

原文:http://www.cnblogs.com/daocaorenblog/p/4779882.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!