Advertisement

华为OD机试真题:C++数字字符串组合倒序(2022 Q4)- 100分

阅读量:
复制代码
    I am an 20-years out--standing @ * -stu- dent
    
    
复制代码
    dent stu standing out 20-years an am I
    
    

C++代码实现方式一:

复制代码
 #include <bits/stdc++.h>

    
  
    
 using namespace std;
    
  
    
 bool isValid(char ch) {
    
     return (islower(ch) || isupper(ch) || isdigit(ch));
    
 }
    
  
    
 void SplitString(string input, vector<string>& output, string pattern) {
    
     string::size_type pos;
    
     input += pattern;
    
     for (int i = 0; i < input.size(); i++)
    
     {
    
     pos = input.find(pattern, i);
    
     if (pos < input.siz

全部评论 (0)

还没有任何评论哟~