Language: C++

#include <iostream>
const int NUM 10000
const int INF 1 << 20

using namespace std;

int main() {
    long long i, a[NUM];
    long long max = -INF, min = INF, sum = 0;
    cin >> i;
    i = 0;
    while (cin >> a[i]) {
        if (max < a[i]) max = a[i];
        if (min > a[i]) min = a[i];
        sum += a[i++];
    }
    cout << min << ' ' << max << ' ' << sum << endl;
    return 0;
}


Compiler output:
a.cc:2:15: error: expected initializer before numeric constant
    2 | const int NUM 10000
      |               ^~~~~
a.cc: In function 'int main()':
a.cc:8:20: error: 'NUM' was not declared in this scope
    8 |     long long i, a[NUM];
      |                    ^~~
a.cc:9:22: error: 'INF' was not declared in this scope
    9 |     long long max = -INF, min = INF, sum = 0;
      |                      ^~~
a.cc:10:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |     cin >> i;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:12:19: error: 'a' was not declared in this scope
   12 |     while (cin >> a[i]) {
      |                   ^
a.cc:14:13: error: 'min' was not declared in this scope; did you mean 'std::min'?
   14 |         if (min > a[i]) min = a[i];
      |             ^~~
      |             std::min
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:15:9: error: 'sum' was not declared in this scope
   15 |         sum += a[i++];
      |         ^~~
a.cc:17:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |     cout << min << ' ' << max << ' ' << sum << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:17:13: error: 'min' was not declared in this scope; did you mean 'std::min'?
   17 |     cout << min << ' ' << max << ' ' << sum << endl;
      |             ^~~
      |             std::min
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:17:41: error: 'sum' was not declared in this scope
   17 |     cout << min << ' ' << max << ' ' << sum << endl;
      |                                         ^~~
a.cc:17:48: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   17 |     cout << min << ' ' << max << ' ' << sum << endl;
      |                                                ^~~~
      |                                                std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~