121022024-12-02 15:15:52mártonágnesKéséscpp17Forditási hiba
#include <iostream>
#include <map>

using namespace std;

int main()
{
    int N, x;
    cout << "N="; cin >> N;
    map <int, int> E;
    for (int i=1; i<=N; i++)
    {
        cin>>x;
        E[x]=i;
    }
    int mini=INT_MAX;
    map <int, int> :: iterator y;
    for (y=E.begin(); y!=E.end(); y++)
    {
        if (y->second<mini) mini=y->second;
    }
    cout << mini;
    return 0;
}
Forditási hiba
open /var/local/lib/isolate/413/box/a.out: no such file or directory
main.cpp: In function 'int main()':
main.cpp:16:14: error: 'INT_MAX' was not declared in this scope
   16 |     int mini=INT_MAX;
      |              ^~~~~~~
main.cpp:3:1: note: 'INT_MAX' is defined in header '<climits>'; did you forget to '#include <climits>'?
    2 | #include <map>
  +++ |+#include <climits>
    3 |