126342024-12-27 13:46:09ffteklaAranycipők (45)cpp17Forditási hiba
#include <iostream>

using namespace std;

int N,i,G[50],maxi=INT_MIN,db,x[50],j;
int main()
{
    cin>>N;
    for (i=1;i<=N;++i)
        cin>>G[i];

    for (i=1;i<=N;++i)
    {
        if (G[i]>maxi)
            maxi=G[i];
    }
    cout<<endl;
    cout<<maxi;
    cout<<endl;

    for (i=1;i<=N;++i)
    {
        if (G[i]==maxi)
        {
            x[i]=i;
            ++db;
        }
    }
    cout<<db;
    cout<<endl;
    for (i=1;i<=N;++i)
    {
        if (x[i]!=0)
            cout<<x[i]<<endl;
    }
    return 0;
}
Forditási hiba
open /var/local/lib/isolate/422/box/a.out: no such file or directory
main.cpp:5:20: error: 'INT_MIN' was not declared in this scope
    5 | int N,i,G[50],maxi=INT_MIN,db,x[50],j;
      |                    ^~~~~~~
main.cpp:2:1: note: 'INT_MIN' is defined in header '<climits>'; did you forget to '#include <climits>'?
    1 | #include <iostream>
  +++ |+#include <climits>
    2 | 
main.cpp: In function 'int main()':
main.cpp:25:13: error: 'x' was not declared in this scope
   25 |             x[i]=i;
      |             ^
main.cpp:26:15: error: 'db' was not declared in this scope
   26 |             ++db;
      |               ^~
main.cpp:29:11: error: 'db' was not declared in this scope
   29 |     cout<<db;
      |           ^~
main.cpp:33:13: error: 'x' was not declared in this scope
   33 |         if (x[i]!=0)
      |             ^