7726 | 2024-01-10 18:29:30 | fftekla | Aranycipők (45) | cpp17 | Compilation error |
#include <iostream>
using namespace std;
int n,i,v[50],maxi,db,x[50],j;
int main()
{
cin>>n;
for (i=1;i<=n;++i)
cin>>v[i];
maxi=INT_MIN;
for (i=1;i<=n;++i)
{
if (v[i]>maxi)
maxi=v[i];
}
cout<<maxi;
cout<<endl;
for (i=1;i<=n;++i)
{
if (v[i]==maxi)
{
x[i]=i;
++db;
}
}
cout<<db;
cout<<endl;
for (i=1;i<=n;++i)
{
if (x[i]!=0)
cout<<x[i]<<endl;
}
}
exit status 1
main.cpp: In function 'int main()':
main.cpp:12:10: error: 'INT_MIN' was not declared in this scope
12 | maxi=INT_MIN;
| ^~~~~~~
main.cpp:2:1: note: 'INT_MIN' is defined in header '<climits>'; did you forget to '#include <climits>'?
1 | #include <iostream>
+++ |+#include <climits>
2 |
Exited with error status 1