F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_39390453_27159.cpp: In function 'int main()':
0_0_39390453_27159.cpp:7:18: error: invalid conversion from 'char' to 'std::basic_istream<char>::char_type*' {aka 'char*'} [-fpermissive]
    7 |     std::cin.get(input, 3);
      |                  ^~~~~
      |                  |
      |                  char
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/iostream:42,
                 from 0_0_39390453_27159.cpp:1:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/istream:444:22: note:   initializing argument 1 of 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::get(char_type*, std::streamsize) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; char_type = char; std::streamsize = long long int]'
  444 |       get(char_type* __s, streamsize __n)
      |           ~~~~~~~~~~~^~~
0_0_39390453_27159.cpp:8:37: error: no matching function for call to 'all_of(char&, int, int (&)(int))'
    8 |     if (input != '\0' && std::all_of(input, input + 3, ::isalpha)) {
      |                          ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/algorithm:61,
                 from 0_0_39390453_27159.cpp:2:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:458:5: note: candidate: 'template<class _IIter, class _Predicate> constexpr bool std::all_of(_IIter, _IIter, _Predicate)'
  458 |     all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
      |     ^~~~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:458:5: note:   template argument deduction/substitution failed:
0_0_39390453_27159.cpp:8:37: note:   deduced conflicting types for parameter '_IIter' ('char' and 'int')
    8 |     if (input != '\0' && std::all_of(input, input + 3, ::isalpha)) {
      |                          ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/algorithm:73:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/pstl/glue_algorithm_defs.h:30:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Predicate> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool> std::all_of(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Predicate)'
   30 | all_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
      | ^~~~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/pstl/glue_algorithm_defs.h:30:1: note:   template argument deduction/substitution failed:
0_0_39390453_27159.cpp:8:37: note:   deduced conflicting types for parameter '_ForwardIterator' ('int' and 'int (*)(int)')
    8 |     if (input != '\0' && std::all_of(input, input + 3, ::isalpha)) {
      |                          ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0_0_39390453_27159.cpp:9:18: error: no matching function for call to 'sort(char&, int)'
    9 |         std::sort(input, input + 3);
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:4851:5: note: candidate: 'template<class _RAIter> constexpr void std::sort(_RAIter, _RAIter)'
 4851 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:4851:5: note:   template argument deduction/substitution failed:
0_0_39390453_27159.cpp:9:18: note:   deduced conflicting types for parameter '_RAIter' ('char' and 'int')
    9 |         std::sort(input, input + 3);
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:4882:5: note: candidate: 'template<class _RAIter, class _Compare> constexpr void std::sort(_RAIter, _RAIter, _Compare)'
 4882 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:4882:5: note:   template argument deduction/substitution failed:
0_0_39390453_27159.cpp:9:18: note:   deduced conflicting types for parameter '_RAIter' ('char' and 'int')
    9 |         std::sort(input, input + 3);
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/pstl/glue_algorithm_defs.h:292:1: note:   template argument deduction/substitution failed:
0_0_39390453_27159.cpp:9:18: note:   candidate expects 4 arguments, 2 provided
    9 |         std::sort(input, input + 3);
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/pstl/glue_algorithm_defs.h:296:1: note:   template argument deduction/substitution failed:
0_0_39390453_27159.cpp:9:18: note:   candidate expects 3 arguments, 2 provided
    9 |         std::sort(input, input + 3);
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~
0_0_39390453_27159.cpp:11:30: error: 'begin' was not declared in this scope
   11 |         for (const char& c : input) {
      |                              ^~~~~
0_0_39390453_27159.cpp:11:30: note: suggested alternatives:
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/string:53,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/locale_classes.h:40,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/ios_base.h:41,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/ios:44,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/ostream:40,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/iostream:41:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/range_access.h:114:37: note:   'std::begin'
  114 |   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept;
      |                                     ^~~~~
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/string_view:48,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/basic_string.h:47,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/string:54:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/ranges_base.h:489:44: note:   'std::ranges::__cust::begin'
  489 |     inline constexpr __cust_access::_Begin begin{};
      |                                            ^~~~~
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_iterator_base_types.h:71,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_construct.h:61,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/char_traits.h:57,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/ios:42:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/iterator_concepts.h:969:10: note:   'std::ranges::__cust_access::begin'
  969 |     void begin(const auto&) = delete;
      |          ^~~~~
0_0_39390453_27159.cpp:11:30: error: 'end' was not declared in this scope
   11 |         for (const char& c : input) {
      |                              ^~~~~
0_0_39390453_27159.cpp:11:30: note: suggested alternatives:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/range_access.h:116:37: note:   'std::end'
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/ranges_base.h:490:42: note:   'std::ranges::__cust::end'
  490 |     inline constexpr __cust_access::_End end{};
      |                                          ^~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/ranges_base.h:137:10: note:   'std::ranges::__cust_access::end'
  137 |     void end(const auto&) = delete;
      |          ^~~


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-09-28 06:20:40, Gzip enabled