摘要: 一直奇怪下面一段程序怎樣才結束,按多少次回車也沒用。#include<iostream>int main(){ int amount=0,value; while(std::cin>>value) if(value<=0) ++amount; std::cout<<"Amount of all negative values read is" <<amount<<std::endl; return 0;}有人說要按兩次Ctrl+z再按回車,有人說直接輸入EOF就ok。試了下,原來是這樣的。Ctrl+z+回車+ 阅读全文
posted @ 2012-08-23 09:29 vinsonLu 阅读(2135) 评论(0) 推荐(0) 编辑