12107 | 2024-12-02 15:19:27 | mártonágnes | Késés | cpp11 | Forditá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;
}
open /var/local/lib/isolate/437/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 |