No.1508  代码:https://code.csdn.net/snippets/192058

考察点:①char型字符转换成对应的 ASKII 的编码

 

可以通过这样对 string 的每一个字符进行操作

    string comet;
    for(string::size_type i=0; i<comet.size(); i++)
    {
        comet[i];
    }

 

使用 string 型,cout、cin 时,必须加上头文件

#include <string>
#include <iostream>

否则会提示 类型未初始化的错误

似乎加上 #include <string.h> 并不能解决

 

相关文章:

  • 2021-08-12
  • 2021-09-30
  • 2021-10-11
  • 2021-06-23
  • 2021-11-18
  • 2021-06-08
  • 2021-06-26
  • 2021-04-17
猜你喜欢
  • 2021-07-16
  • 2021-12-30
  • 2021-06-21
  • 2021-12-02
  • 2021-08-07
  • 2022-03-15
相关资源
相似解决方案