C++低级小程序知多少,你能找到多少是多少

C++初级小程序知多少,你能找到多少是多少
</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;
}





1楼u0112206995小时前
自己先顶一下吧!