#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"); }
——————————————————————————————————————————————————
//写的错误或者不好的地方请多多指导,可以在下面留言或者给我发邮件,指出我的错误以及不足,以便我修改,更好的分享给大家,谢谢。
转载请注明出处:https://www.royalchen.com/
author:royalchen
Email:royalchen@royalchen.com
———————————————————————————————————————————————————