C++求字符串最长连续字符的长度的代码
下边内容是关于 C++求字符串最长连续字符的长度的内容。
#include<assert.h> { assert(s!=NULL); int temp_count,final_count=0; p=s; { temp_count=0; { temp_count++; else break; } if(temp_count>final_count) { final_char=temp_char; final_count=temp_count; } } return final_count; } void main() { char s[]="aabbbcccc"; int count; char c; count=get_max_char_count(s,&c); printf("%c is appeared %d timesn",c,count); }
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。