两个c++程序

来源:互联网 发布:图片轮播js代码讲解 编辑:程序博客网 时间:2024/05/18 13:06

 #include <iostream>
using std::cout;
int main()
{
int i=0;
cout < <i++ < <i++ < <i++ < <endl;
return 0;
}
为啥输出为210呢?
我想像的是012撒~

#include <iostream>
#include <string>
using std::string;
using std::cout;
using std::cin;
using std::endl;

int main()
{

string word;
while(cin>>word)
cout < <word < <endl;//结束只能应用contrl+z
return 0;
}
还有此小程序,请输入带空格的一句话 eg:"wo men dou shi hunman"
输出为啥会出现换行呢?即输出为
wo
men
dou
shi
human

原创粉丝点击