标签:cin cin.get getchar putchar cout.put
</pre><pre name="code" class="cpp"><pre name="code" class="cpp">//cin 与 cin.get()之间的区别
//cin读取时忽略空格或是换行符
//cin.get()则是检测那些空格,制表符和换行符
#include <iostream>
//#include <cstdio>
int main()
{
using namespace std;
cout<<"Plase enter the sentence : "<<endl;
char ch;
int count=0;
// cin>>ch;
cin.get(ch);//ch=cin.get();
while(ch!='#')
{
putchar(ch);
//cout.put(ch);
//cout<<ch;
++count;
//cin>>ch;//get the next char
ch=getchar();//c
//ch=cin.get();//cin.get(ch);
}
cout<<endl<<count<<" is here."<<endl;
return 0;
}C++初级小程序知多少,你能找到多少是多少,布布扣,bubuko.com
标签:cin cin.get getchar putchar cout.put
原文地址:http://blog.csdn.net/u011220699/article/details/32699175