Language: C++

#include<bits/stdc++.h>
using namespace std;

int main()
{
  	vector <vector <string> > v;
  	v[0].push_back("Sunny");
  	v[1].push_back("Cloudy");
  	v[2].push_back("Rainy");
  	string str;
  	cin>>str;
  	for(int i : v )
  	if(str.compare(v[i]) == 0)
    {
      	cout<<v[(i+1)%3];
    }
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: cannot convert 'std::vector<std::__cxx11::basic_string<char> >' to 'int' in initialization
   12 |         for(int i : v )
      |                     ^
a.cc:13:23: error: no matching function for call to 'std::__cxx11::basic_string<char>::compare(__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type&)'
   13 |         if(str.compare(v[i]) == 0)
      |            ~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:3249:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, int> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::compare(const _Tp&) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 3249 |         compare(const _Tp& __svt) const
      |         ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3249:9: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = int]':
/usr/include/c++/14/bits/basic_string.h:149:8:   required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = std::vector<std::__cxx11::basic_string<char> >; _Res = int; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  149 |         using _If_sv = enable_if_t<
      |               ^~~~~~
/usr/include/c++/14/bits/basic_string.h:3249:2:   required by substitution of 'template<class _Tp> std::__cxx11::basic_string<char>::_If_sv<_Tp, int> std::__cxx11::basic_string<char>::compare(const _Tp&) const [with _Tp = std::vector<std::__cxx11::basic_string<char> >]'
 3249 |         compare(const _Tp& __svt) const
      |         ^~~~~~~
a.cc:13:18:   required from here
   13 |         if(str.compare(v[i]) == 0)
      |            ~~~~~~~~~~~^~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, int>'
 2711 |     using enable_if_t = typename enable_if<_Cond, _Tp>::type;
      |           ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3274:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, int> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::compare(size_type, size_type, const _Tp&) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 3274 |         compare(size_type __pos, size_type __n, const _Tp& __svt) const
      |         ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3274:9: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:3294:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, int> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::compare(size_type, size_type, const _Tp&, size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 3294 |         compare(size_type __pos1, size_type __n1, const _Tp& __svt,
      |         ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3294:9: note:   candidate expects 4 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:3228:7: note: candidate: 'int std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::compare(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 3228 |       compare(const basic_string& __str) const
      |       ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3228:35: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'} to 'const std::__cxx11::basic_string<char>&'
 3228 |       compare(const basic_string& __str) const
      |               ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:3325:7: note: candidate: 'int std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::compare(size_type, size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 3325 |       compare(size_type __pos, size_type __n, const basic_string& __str) const
      |       ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3325:7: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:3362:7: note: candidate: 'int std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::compare(size_type, size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 3362 |       compare(size_type __pos1, size_type __n1, const basic_string& __str,
      |       ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3362:7: note:   candidate expects 5 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:3393:7: note: candidate: 'int std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::compare(const _CharT*) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 3393 |       compare(const _CharT* __s) const _GLIBCXX_NOEXCEPT
      |       ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3393:29: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'} to 'const char*'
 3393 |       compare(const _CharT* __s) const _GLIBCXX_NOEXCEPT
      |               ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:3428:7: note: candidate: 'int std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::compare(size_type, size_type, const _CharT*) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 3428 |       compare(size_type __pos, size_type __n1, const _CharT* __s) const
      |       ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3428:7: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:3467:7: note: candidate: 'int std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::compare(size_type, size_type, const _CharT*, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 3467 |       compare(size_type __pos, size_type __n1, const _CharT* __s,
      |       ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3467:7: note:   candidate expects 4 arguments, 1 provided
a.cc:15:13: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'})
   15 |         cout<<v[(i+1)%3];
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  116 |       operator<<(__ostream_type& (*__pf)(__ostream_type&))
      |       ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'} to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
  116 |       operator<<(__ostream_type& (*__pf)(__ostream_type&))
      |                  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
  125 |       operator<<(__ios_type& (*__pf)(__ios_type&))
      |       ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'} to 'std::basic_ostream<char>::__ios_type& (*)(std::