
华为OJ(1)
文章平均质量分 61
Fight_Now
这个作者很懒,什么都没留下…
展开
-
公共字串计算
//公共字串计算#include #include using namespace std;int getCommonStrLength(char * pFirstStr, char * pSecondStr){ int len1 = strlen(pFirstStr); int len2 = strlen(pSecondStr); char *s1 = pFirstStr;原创 2015-05-24 10:39:50 · 255 阅读 · 0 评论 -
字符串反转
//字符串反转#include #include using namespace std;int main(){ string s; getline(cin, s); if (s.size() == 0) return 0; for (int i = s.size() -1; i >= 0; i--) { cout << s[i]; } cout << endl;原创 2015-05-24 10:45:05 · 188 阅读 · 0 评论 -
统计大写字母个数
//统计大写字母个数#include #include using namespace std;int CalcCapital(string str){ if (str.size() == 0) { cout << 0 << endl; return 0; } int count = 0; for (int i = 0; i < str.size(); i++)原创 2015-05-24 10:41:48 · 375 阅读 · 0 评论 -
计算字符串最后一个单词的长度,单词以空格隔开
//计算字符串最后一个单词的长度,单词以空格隔开#include #include using namespace std;int main(){ string s; getline(cin, s); int count = 0; if (s.size() <= 0) { cout << 0 << endl; return 0; } int len = s.siz原创 2015-05-24 10:38:22 · 659 阅读 · 0 评论