fork(3) download
  1. #include <iostream>
  2. #include <string>
  3. #include <regex>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. string s = "中文123,英文abc...";
  9. string r = "";
  10. const char* c = s.c_str();
  11. for (int i = 0; i < s.length(); i++)
  12. if (c[i] > 256 || c[i] < 0)
  13. r += c[i];
  14. cout << r << endl;
  15. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
中文英文