记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:12:12: error: missing template arguments before '(' token
   12 |         map(char,int> cnt;
      |            ^
foo.cc:12:13: error: expected primary-expression before 'char'
   12 |         map(char,int> cnt;
      |             ^~~~
foo.cc:12:18: error: expected primary-expression before 'int'
   12 |         map(char,int> cnt;
      |                  ^~~
foo.cc:13:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |         for(int i=0;i<s.length();i++)
      |                     ~^~~~~~~~~~~
foo.cc:20:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |         for(int i=0;i<s.length();i++)
      |                     ~^~~~~~~~~~~
foo.cc:24:28: error: 'Set' was not declared in this scope
   24 |                         if(Set.count(s[i])==0) cnt[s[i]]=0;
      |                            ^~~
foo.cc:24:48: error: 'cnt' was not declared in this scope; did you mean 'int'?
   24 |                         if(Set.count(s[i])==0) cnt[s[i]]=0;
      |                                                ^~~
      |                                                int
foo.cc:25:25: error: 'cnt' was not declared in this scope; did you mean 'int'?
   25 |                         cnt[s[i]]++;
      |                         ^~~
      |                         int
foo.cc:30:21: error: 'cnt' was not declared in this scope; did you mean 'int'?
   30 |         for(auto it=cnt.begin();it!=cnt.end();it++)
      |                     ^~~
      |                     int
foo.cc:35:21: error: 'cnt' was not declared in this scope; did you mean 'int'?
   35 |         for(auto it=cnt.begin();it!=cnt.end();it++)
      |                     ^~~
      |                     int
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P2988 6-9 哪个字母用得最多
语言
C++
递交时间
2023-12-05 14:32:22
评测时间
2023-12-05 14:32:22
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes