/in/foo.cc: In function 'int main()':
/in/foo.cc:15:16: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]' (did you forget the '()' ?)
for(i=0;i<str.length;i++)
~~~~^~~~~~
/in/foo.cc:19:9: error: 'ch' was not declared in this scope
else ch[a[i]]++;
^~
/in/foo.cc:22:14: error: 'ch' was not declared in this scope
for(auto it:ch)
^~
/in/foo.cc:25:7: error: redeclaration of 'int x'
int x=it.second;
^
/in/foo.cc:24:7: note: 'int x' previously declared here
int x=it.first;
^