178782025-09-21 19:51:46algoproFasor (40)cpp17Forditási hiba
// UUID: e046bab0-f2eb-4cb9-80f5-7f8d2f11411b
#include <bits/stdc++.h>
using namespace std;

int main() {
	int N;
	int K;
	cin>>N>>K;
	int pos=0; 
	int h=0;
	int maxpos=0;
	while(pos<N){
		int actual;
		cin>>actual;
		if(actual>h){
			h=actual;
			maxpos=pos;
		}
		if(pos-maxpos>K){
			cout>>maxpos;
			exit(0)
		}
		pos++
	}

}
Forditási hiba
open /var/local/lib/isolate/425/box/a.out: no such file or directory
main.cpp: In function 'int main()':
main.cpp:20:29: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
   20 |                         cout>>maxpos;
      |                         ~~~~^~~~~~~~
      |                         |     |
      |                         |     int
      |                         std::ostream {aka std::basic_ostream<char>}
main.cpp:20:29: note: candidate: 'operator>>(int, int)' (built-in)
   20 |                         cout>>maxpos;
      |                         ~~~~^~~~~~~~
main.cpp:20:29: note:   no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/x86_64-linux-gnu/c++/12/bits/stdc++.h:45,
                 from main.cpp:2:
/usr/include/c++/12/cstddef:128:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
  128 |     operator>>(byte __b, _IntegerType __shift) noexcept
      |     ^~~~~~~~
/usr/include/c++/12/cstddef:128:5: note:   template argument deduction/substitution failed:
main.cpp:20:25: note:   cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
   20 |                         cout>>maxpos;
      |                         ^~~~
In file included from /usr/include/c++/12/string:54,
                 from /usr/include/c++/12/bits/locale_classes.h:40,
                 from /usr/include/c++/12/bits/ios_base.h:41,
                 from /usr/include/c++/12/ios:42,
                 from /usr/include/c++/12/istream:38,
                 from /usr/include/c++/12/sstream:38,
                 from /usr/include/c++/12/complex:45,
                 from /usr/include/c++/12/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/12/bits/stdc++.h:54:
/usr/include/c++/12/bits/basic_string.tcc:940:5: note: candidate: 'template<class _CharT, class _Traits...