Compile Error

foo.cc:173:11: warning: missing terminating ' character
  173 |  char s,h='*;
      |           ^
foo.cc:173:11: error: missing terminating ' character
  173 |  char s,h='*;
      |           ^~~
foo.cc: In function 'int countChar(std::string, char)':
foo.cc:12:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |  for(int i=0;i<s.size();i++)
      |              ~^~~~~~~~~
foo.cc: In function 'void maxChar(std::string)':
foo.cc:33:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |  for(i=0;i<s.length();i++)
      |          ~^~~~~~~~~~~
foo.cc:35:9: warning: array subscript has type 'char' [-Wchar-subscripts]
   35 |   m[s[i]]++;
      |         ^
foo.cc: In function 'int longestSubStr(std::string)':
foo.cc:149:6: warning: unused variable 't' [-Wunused-variable]
  149 |  int t,i,n,len,rk;
      |      ^
foo.cc: In function 'int main()':
foo.cc:174:5: error: cannot convert 'std::basic_istream<char>' to 'char' in initialization
  174 |  cin>>s;
      |  ~~~^~~
      |     |
      |     std::basic_istream<char>
foo.cc:175:19: error: could not convert 's' from 'char' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
  175 |  cout<<removeChar(s,h);
      |                   ^
      |                   |
      |                   char
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1105 删除指定字符
语言
C++
递交时间
2022-07-18 12:54:57
评测时间
2022-07-18 12:54:57
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes