摘要: #include using namespace std; int main(void){ char s[100]; int i=0; cin >> s; for(i=0; *(s+i)!='\0'; ++i)continue; cout <<i; return 0; } 阅读全文
posted @ 2017-02-27 11:19 ZaleJ 阅读(186) 评论(0) 推荐(0) 编辑
摘要: /* 逐个读取字符串中的字符,当所给字符与字符串中的字符相同时,计数器count的值加1后继续查找,直到字符串尾。 一个完整的参考程序如下: */ #include //#include void main() { using namespace std; int count =0; int j; char str[100],c[100]; cout>... 阅读全文
posted @ 2017-02-27 11:18 ZaleJ 阅读(527) 评论(0) 推荐(0) 编辑