/*Wpl
C++输出汉字的方法
2009,05,30,1:37*/
#include <iostream>
#include <string>
using namespace std;
string str="汉字里有english也能正确显示,hehe";

int main()
 {
  int i = 0,len=str.length();
  while (i<len)
  {
    if(str[i] < 0)
 {
       printf("%c%c", str[i], str[i+1]);
       i++;
    }
    else
 {
      printf("%c", str[i]);
    }
    i++;
  }
  return 0;
}

 

相关文章:

  • 2022-12-23
  • 2021-05-28
  • 2022-12-23
  • 2021-10-04
  • 2021-07-27
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-05
  • 2022-12-23
  • 2021-10-05
  • 2022-02-10
相关资源
相似解决方案