C++ primer plus第六版课后编程题答案17.1


 

 

#include <iostream>
using namespace std;
int main()
{
    cout<<"Enter the str:";
    int count=0;
    char ch;
    while(cin.peek()!='$')
    {
         cin>>ch;
         count++;         
    }
    cout<<"\nIt has "<<count<<"  char "<<endl;
    cin.get();
    cin.get();
    system("pause");
       
    
    
} 

 

 


发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注