Language: C++

#include <iostream>                                                                                                              
   
using namespace std;
   
   int main(){
   
?-------string str1,str2,str3;
?-------cin >> str1 >> str2 >> str3;
?-------cout << str1[0] << str2[1] << str3[2];
    ?-------return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: expected primary-expression before '?' token
    7 | ?-------string str1,str2,str3;
      | ^
a.cc:7:16: error: expected primary-expression before 'str1'
    7 | ?-------string str1,str2,str3;
      |                ^~~~
a.cc:7:15: error: expected ':' before 'str1'
    7 | ?-------string str1,str2,str3;
      |               ^~~~~
      |               :
a.cc:7:16: error: 'str1' was not declared in this scope
    7 | ?-------string str1,str2,str3;
      |                ^~~~
a.cc:7:21: error: 'str2' was not declared in this scope
    7 | ?-------string str1,str2,str3;
      |                     ^~~~
a.cc:7:26: error: 'str3' was not declared in this scope
    7 | ?-------string str1,str2,str3;
      |                          ^~~~
a.cc:8:1: error: expected primary-expression before '?' token
    8 | ?-------cin >> str1 >> str2 >> str3;
      | ^
a.cc:8:8: error: no match for 'operator-' (operand type is 'std::istream' {aka 'std::basic_istream<char>'})
    8 | ?-------cin >> str1 >> str2 >> str3;
      |        ^~~~
a.cc:8:8: note: candidate: 'operator-(int)' (built-in)
a.cc:8:8: note:   no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/string:48,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   candidate expects 2 arguments, 1 provided
a.cc:8:36: error: expected ':' before ';' token
    8 | ?-------cin >> str1 >> str2 >> str3;
      |                                    ^
      |                                    :
a.cc:8:36: error: expected primary-expression before ';' token
a.cc:9:1: error: expected primary-expression before '?' token
    9 | ?-------cout << str1[0] << str2[1] << str3[2];
      | ^
a.cc:9:8: error: no match for 'operator-' (operand type is 'std::ostream' {aka 'std::basic_ostream<char>'})
    9 | ?-------cout << str1[0] << str2[1] << str3[2];
      |        ^~~~~
a.cc:9:8: note: candidate: 'operator-(int)' (built-in)
a.cc:9:8: note:   no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   candidate expects 2 arguments, 1 provided
a.cc:9:46: error: expected ':' before ';' token
    9 | ?-------cout << str1[0] << str2[1] << str3[2];
      |                                              ^
      |                                              :
a.cc:9:46: error: expected primary-expression before ';' token
a.cc:10:5: error: expected primary-expression before '?' token
   10 |     ?-------return 0;
      |     ^
a.cc:10:13: error: expected primary-expression before 'return'
   10 |     ?-------return 0;
      |             ^~~~~~
a.cc:10:13: error: expected ':' before 'return'
   10 |     ?-------return 0;
      |             ^~~~~~
      |             :
a.cc:10:13: error: expected primary-expression before 'return'
   10 |     ?-------return 0;
      |             ^~~~~~