criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
using namespace std;

int main()
{
	int n,i,j;
	cin >> n;//??´??°????????°
	
	long long a[10000], max = 0,min = 0 ,sum = 0;
	
	for(i=0 ;i<n ;i++){
		cin >> a[i];
	}
	
	max = a[0];
	min = a[0];
	for(j=0 ;j<n ; j++){
		if(max < a[j]){
			max = a;}
		if(min > a[j]){
			min = a;}
		sum = sum + a[j];
	}
	
	count << min << " " << max << " " << sum <<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:31: error: invalid conversion from 'long long int*' to 'long long int' [-fpermissive]
   19 |                         max = a;}
      |                               ^
      |                               |
      |                               long long int*
a.cc:21:31: error: invalid conversion from 'long long int*' to 'long long int' [-fpermissive]
   21 |                         min = a;}
      |                               ^
      |                               |
      |                               long long int*
a.cc:25:9: error: 'count' was not declared in this scope
   25 |         count << min << " " << max << " " << sum <<endl;
      |         ^~~~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
	int n,i,j;
	cin >> n;//??´??°????????°
	
	long long a[10000], max = 0,min = 0 ,sum = 0;
	
	for(i=0 ;i<n ;i++){
		cin >> a[i];
	}
	
	max = a[0];
	min = a[0];
	for(j=0 ;j<n ; j++){
		if(max < a[j]){
			max = a[j];}
		if(min > a[j]){
			min = a[j];}
		sum = sum + a[j];
	}
	
	count << min << " " << max << " " << sum <<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'count' was not declared in this scope
   25 |         count << min << " " << max << " " << sum <<endl;
      |         ^~~~~
Language: C++

#include<stdio.h>
int main()
{
	int An[10000], i;
	long max, min,amount,n;
	max = -1000000;
	min = 1000000;
	amount = 0;
	scanf("%d", &n);
	for (i = 0; i=<n; i++)
	{
		scanf("%d", &An[i]);
		if (max < An[i])
		{
			max = An[i];
		}
		if (min > An[i])
		{
			min = An[i];
		}
		amount = amount + An[i];
	}
	printf("%d %d %d\n", min, max, amount);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: expected primary-expression before '<' token
   10 |         for (i = 0; i=<n; i++)
      |                       ^
Language: C++

#include <iostream>   

int main ()
{
	int n;
	long long a;
	long long minValue = 1000000;
	long long maxValue = -1000000;
	long long sum = 0;

	cin >> n;

	for ( int i = 0; i < n; i++ ){
		cin >> a;
		if ( a < minValue ) minValue = a;
		if ( a < maxValue ) maxValue = a;
		sum += a;
	}
	cout << minValue << " " << maxValue << " " << sum << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   11 |         cin >> n;
      |         ^~~
      |         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:19:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |         cout << minValue << " " << maxValue << " " << 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:19:62: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 |         cout << minValue << " " << maxValue << " " << sum << endl;
      |                                                              ^~~~
      |                                                              std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;

int main(){
	int n;
	cin >> n;
	vector<int> A;
	A.push_back(0);
	int S = 0;
	for(int i = 1; i <= n; i++){
		cin >> a;
		A.push_back(a);
		int m = A(i-1);
		if(A(i) < m) m = A(i);
		int M = A(i-1);
		if(A(i) > M) M = A(i);
		int S += A(i);
	}
	cout << m << ' ' << M << ' ' << S << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: 'a' was not declared in this scope
   12 |                 cin >> a;
      |                        ^
a.cc:14:26: error: no match for call to '(std::vector<int>) (int)'
   14 |                 int m = A(i-1);
      |                         ~^~~~~
a.cc:15:21: error: no match for call to '(std::vector<int>) (int&)'
   15 |                 if(A(i) < m) m = A(i);
      |                    ~^~~
a.cc:15:35: error: no match for call to '(std::vector<int>) (int&)'
   15 |                 if(A(i) < m) m = A(i);
      |                                  ~^~~
a.cc:16:26: error: no match for call to '(std::vector<int>) (int)'
   16 |                 int M = A(i-1);
      |                         ~^~~~~
a.cc:17:21: error: no match for call to '(std::vector<int>) (int&)'
   17 |                 if(A(i) > M) M = A(i);
      |                    ~^~~
a.cc:17:35: error: no match for call to '(std::vector<int>) (int&)'
   17 |                 if(A(i) > M) M = A(i);
      |                                  ~^~~
a.cc:18:23: error: expected initializer before '+=' token
   18 |                 int S += A(i);
      |                       ^~
a.cc:20:17: error: 'm' was not declared in this scope
   20 |         cout << m << ' ' << M << ' ' << S << endl;
      |                 ^
a.cc:20:29: error: 'M' was not declared in this scope
   20 |         cout << m << ' ' << M << ' ' << S << endl;
      |                             ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;

int main(){
	int n;
	cin >> n;
	int m, M, S = 0;
	for(int i = 0; i < n; i++){
		cin >> a;
		if(a < m || i == 0) m = a;
		if(a > M || i == 0) M = a;
		int S += a;
	}
	cout << m << ' ' << M << ' ' << S << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: 'a' was not declared in this scope
   10 |                 cin >> a;
      |                        ^
a.cc:13:23: error: expected initializer before '+=' token
   13 |                 int S += a;
      |                       ^~
Language: C++

#include<iostream>
#include<vector>
using namespace std;

int main(){
	int n;
	cin >> n;
	int m, M, S = 0;
	for(int i = 0; i < n; i++){
		int a;
		cin >> a;
		if(a < m || i == 0) m = a;
		if(a > M || i == 0) M = a;
		int S += a;
	}
	cout << m << ' ' << M << ' ' << S << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: expected initializer before '+=' token
   14 |                 int S += a;
      |                       ^~
Language: C++

int main(void){
int i,n;
int number;
long long int sum=0;
int min=0;
int max=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&number);
if(i==0){#include<stdio.h>

min=number;
max=number;
}
if(number<min)min=number;
if(number>max)max=number;
sum+=number;
}
printf("%d %d %lld\n",min,max,sum);
return 0;
}

Compiler output:
a.cc:10:10: error: stray '#' in program
   10 | if(i==0){#include<stdio.h>
      |          ^
a.cc: In function 'int main()':
a.cc:7:1: error: 'scanf' was not declared in this scope
    7 | scanf("%d",&n);
      | ^~~~~
a.cc:10:11: error: 'include' was not declared in this scope
   10 | if(i==0){#include<stdio.h>
      |           ^~~~~~~
a.cc:10:19: error: 'stdio' was not declared in this scope; did you mean 'std'?
   10 | if(i==0){#include<stdio.h>
      |                   ^~~~~
      |                   std
a.cc:19:1: error: 'printf' was not declared in this scope
   19 | printf("%d %d %lld\n",min,max,sum);
      | ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(void){
Language: C++

#include<stdio.h>
int main(void){
int i,n;
int number;
long long int sum=0;
int min=0;
int max=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&number);
if(i==0){#include<stdio.h>

min=number;
max=number;
}
if(number<min)min=number;
if(number>max)max=number;
sum+=number;
}
printf("%d %d %lld\n",min,max,sum);
return 0;
}

Compiler output:
a.cc:11:10: error: stray '#' in program
   11 | if(i==0){#include<stdio.h>
      |          ^
a.cc: In function 'int main()':
a.cc:11:11: error: 'include' was not declared in this scope
   11 | if(i==0){#include<stdio.h>
      |           ^~~~~~~
a.cc:11:19: error: 'stdio' was not declared in this scope; did you mean 'stdin'?
   11 | if(i==0){#include<stdio.h>
      |                   ^~~~~
      |                   stdin
Language: C++

#include<iostream>
using namespace std;

int main(){
int n,sum =0, max = 0, min =0;

cin >> n;

for( i = 0; i < n; i++ ){
 cin >> x;
 sum = sum + x;
 if ( x > max ) max = x;
 if ( x < min ) min = x; 
}

cout << min << " " << max << " " << sum << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:6: error: 'i' was not declared in this scope
    9 | for( i = 0; i < n; i++ ){
      |      ^
a.cc:10:9: error: 'x' was not declared in this scope
   10 |  cin >> x;
      |         ^
Language: C++

#include<stdio.h>


int main(void)


{


int i,n;


int number;


long long int sum=0;


int min=0;


int max=0;


scanf("%d",&n);


for(i=0;i<n+i++)


{


scanf("%d",&number);


if(i==0)


{


min = number;


max = number;


}


if(number<min) min = number;


if(number>max) max = number;


sum += number;


}


printf("%d %d %ll\n",min,max,sum);


return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:16: error: expected ';' before ')' token
   28 | for(i=0;i<n+i++)
      |                ^
      |                ;
Language: C++

#include<stdio.h>


int main(void)


{


int i,n;


int number;


long long int sum=0;


int min=0;


int max=0;


scanf("%d",&n);


for(i=0;i<n+i++)


{


scanf("%d",&number);


if(i==0)


{


min = number;


max = number;


}


if(number<min) min = number;


if(number>max) max = number;


sum += number;


}


printf("%d %d %II\n",min,max,sum);


return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:16: error: expected ';' before ')' token
   28 | for(i=0;i<n+i++)
      |                ^
      |                ;
Language: C++

#include <iostream>
#include <cstdio>
int main(){
	int n,i,a,min,max;
	bigint sum=0;
	std::cin >> n;
	for(i=0;i<n;i++){
		std::cin >> a;
		if(i==0){
			min=a;
			max=a;
			}
		if(min>a) min=a;
		if(max<a) max=a;
			sum=sum+a;
		}
		std::cout << min << " " << max << " " << sum <<std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'bigint' was not declared in this scope
    5 |         bigint sum=0;
      |         ^~~~~~
a.cc:15:25: error: 'sum' was not declared in this scope
   15 |                         sum=sum+a;
      |                         ^~~
a.cc:17:58: error: 'sum' was not declared in this scope
   17 |                 std::cout << min << " " << max << " " << sum <<std::endl;
      |                                                          ^~~
Language: C++

#include<stdio.h>
int main(void)
{
int i,n;
int number;
long long int sum = 0;
int min =0;
int max = 0;

scanf("%d",&n);

for(i=0;i<n;i++)
{
scanf("%d",&number);
if(i==0)
{
min =number;
max = number;
}
if(number<min) min = number;
if(number>max) max = number;

sum += number;
}

printf("%d %d %lld"min,max,sum);

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:8: error: unable to find string literal operator 'operator""min' with 'const char [11]', 'long unsigned int' arguments
   26 | printf("%d %d %lld"min,max,sum);
      |        ^~~~~~~~~~~~~~~
Language: C++

clude<iostream>
#include<cstdio>
using namespace std;
int main(){
	long n,s=0,min=0,max=0,a;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a;
		if(i==0){min=a;max=a;}
		s+=a;
		if(min>a)min=a;
		if(max<a)max=a;
	}
	cout<<min<<" "<<max<<" "<<s<<endl;
    return 0;
}

Compiler output:
a.cc:1:1: error: 'clude' does not name a type
    1 | clude<iostream>
      | ^~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin>>n;
      |         ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<cstdio>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:14:9: error: 'cout' was not declared in this scope
   14 |         cout<<min<<" "<<max<<" "<<s<<endl;
      |         ^~~~
a.cc:14:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:38: error: 'endl' was not declared in this scope
   14 |         cout<<min<<" "<<max<<" "<<s<<endl;
      |                                      ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include<cstdio>
  +++ |+#include <ostream>
    3 | using namespace std;
Language: C++

int main(){
    int n;
    int min=1000000, max=-1000000;
    long sum=0;
    cin >> n;
    for(int i=0; i<n; i++){
        int in;
        cin >> in;
        if(in<min) min = in;
        if(in>max) max = in;
        sum += in;
    }
    cout << min << " " << max << " " << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'min'?
    5 |     cin >> n;
      |     ^~~
      |     min
a.cc:13:5: error: 'cout' was not declared in this scope
   13 |     cout << min << " " << max << " " << sum << endl;
      |     ^~~~
a.cc:13:48: error: 'endl' was not declared in this scope
   13 |     cout << min << " " << max << " " << sum << endl;
      |                                                ^~~~
Language: C++

#include <iostream>
#define REP(i, a, n) for(int i = a; i < n; i++)
using namespace std;


int n;
long M, m, s;

int main(void) {
  cin >> n;

  M = -1000000;
  m =  1000000;
  s = 0;

  REP(i, 0, n) {
    long a;
    cin >> a;
    M = max(M, a);
    m = min(m, a);
    s += a;
  }

  cout << M << " " << m << " " << a << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:35: error: 'a' was not declared in this scope
   24 |   cout << M << " " << m << " " << a << endl;
      |                                   ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	int n;
    long long a;
    long long max = -1000000;
    long long min = 1000000;
    long long sum = 0;

	cin >> n;

	for(int i=0; i<n; i++){
		cin >> a;

		if(a>max){
			max=a;
		}else if(a<min){
			min=a;
		}
		 s += a;

	}
	
	cout << min << " " <<max << " " << s << "\n";
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: error: 's' was not declared in this scope
   21 |                  s += a;
      |                  ^
a.cc:25:44: error: 's' was not declared in this scope
   25 |         cout << min << " " <<max << " " << s << "\n";
      |                                            ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	int n;
    long long int a;
    long long int max = -1000000;
    long long int min = 1000000;
    long long int sum = 0;

	cin >> n;

	for(int i=0; i<n; i++){
		cin >> a;

		if(a>max){
			max=a;
		}else if(a<min){
			min=a;
		}
		 s += a;

	}
	
	cout << min << " " <<max << " " << s << "\n";
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: error: 's' was not declared in this scope
   21 |                  s += a;
      |                  ^
a.cc:25:44: error: 's' was not declared in this scope
   25 |         cout << min << " " <<max << " " << s << "\n";
      |                                            ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	int a,n,min=1000000,max=-1000000;
	long long int s=0;
	cin >> n;

	for(int i=0; i<n; i++){
		cin >> a;
		s += a;

		if(a>max) max=a;
		if(a<min) min=a;
	
	cout << min << " " << max << " " << s << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <limits>
#include <algorithm>

int main()
{
    int n;
    std::cin >> n;

    int max = std::numeric_limits<int>::min();
    int min = std::numeric_limits<int>::max()
    int sum = 0;
    for ( int i = 0; i < n; ++i )
    {
        int a;
        std::cin >> a;

        max = std::max( max, a );
        min = std::min( min, a );
        sum += a;
    }
    std::cout
        << min << " " << max << " " << sum
        << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: expected ',' or ';' before 'int'
   12 |     int sum = 0;
      |     ^~~
a.cc:20:9: error: 'sum' was not declared in this scope
   20 |         sum += a;
      |         ^~~
a.cc:23:40: error: 'sum' was not declared in this scope
   23 |         << min << " " << max << " " << sum
      |                                        ^~~
Language: C++

#include<stdio.h>
int main() 
{
	int i, n, a;
	long sum = 0;
	int max = -1000000, int min = 1000000;
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%d", &a);
		sum += a;
		if (a >= max)
			max = a;
		if (a <= min)
			min = a;
	}
	printf("%d %d %ld\n", min, max, sum);
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:29: error: expected unqualified-id before 'int'
    6 |         int max = -1000000, int min = 1000000;
      |                             ^~~
a.cc:14:26: error: 'min' was not declared in this scope; did you mean 'main'?
   14 |                 if (a <= min)
      |                          ^~~
      |                          main
a.cc:17:31: error: 'min' was not declared in this scope; did you mean 'main'?
   17 |         printf("%d %d %ld\n", min, max, sum);
      |                               ^~~
      |                               main
Language: C++

#include<stdio.h>
int main(void)
{
    int i,n,a;
    long min=1000000,max=-1000000,sum=0;
    scanf("%d",&n);
    for(i=0;b<n;i++){
        scanf("%d",&a);
        if(min>a){
            min=a;
        }
        if(max<a){
            max=a;
        }
        sum+=a;
    }
    printf("%ld %ld %ld\n",min,max,sum);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: 'b' was not declared in this scope
    7 |     for(i=0;b<n;i++){
      |             ^
Language: C++

#include<iostream>
using namespace std;

int main(){
 int min=1000000, max=-1000000, n, tmp, i;
 long sum=0;
 
 cin >> n;
 
 	for(i = 0; i < n; i++) {
 		cin >> tmp;
	
		if ( tmp < min) {
		min = tmp;
		
		if ( tmp > max) {
		max = tmp;

		sum += tmp;
		}
	}
	
  cout << min << " " << max << " " << sum <<endl;

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;

int main(){
 int min=1000000, max=-1000000, n, tmp, i;
 long sum=0;
 
 cin >> n;
 
 	for(i = 0; i < n; i++) {
 		cin >> tmp;
	
		if ( tmp < min) {
		min = tmp;
		
		if ( tmp > max) {
		max = tmp;

		sum += tmp;
		}
	
  cout << min << " " << max << " " << sum <<endl;

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:10:32: note: to match this '{'
   10 |         for(i = 0; i < n; i++) {
      |                                ^
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

int main(){
	int n;
	int min = -100000000;
	int max = 100000000;
	lomg sum;
	int in;

	for(int i=0; i<n; i++){
		cin >> in;
		if(max < in) max = in;
		if(min > in) min = in;
		sum += in;
	}

	cout << min << " " << max << " " << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'lomg' was not declared in this scope; did you mean 'long'?
    8 |         lomg sum;
      |         ^~~~
      |         long
a.cc:15:17: error: 'sum' was not declared in this scope
   15 |                 sum += in;
      |                 ^~~
Language: C++

#include <iostream>
using namespace std;

int main(){
	int n;
	int min = -100000000;
	int max = 100000000;
	long sum=0;
	int x;

	cin >> n;
	for(int i=0; i<n; i++){
		cin >> x;
		if(max < x) max = x;
		if(min > x) min = x;
		sum += in;
	}

	cout << min << " " << max << " " << sum << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:24: error: 'in' was not declared in this scope; did you mean 'i'?
   16 |                 sum += in;
      |                        ^~
      |                        i
Language: C++

#include <iostream>
using namespace std;

int main() {
	long int mini=1000001, max=-100001, sum=0;
	log int n;  cin >> n;
	long int a[n];
	for(int i=1; i<=n; i++){
		cin >> a[i];
		sum = sum + a[i];
		if(max<a[i]) max=a[i];
		if(mini>a[i]) mini=a[i];
	} 
	
	printf("%d %d %d\n", mini, max, sum);
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'log' was not declared in this scope; did you mean 'long'?
    6 |         log int n;  cin >> n;
      |         ^~~
      |         long
a.cc:6:28: error: 'n' was not declared in this scope
    6 |         log int n;  cin >> n;
      |                            ^
a.cc:9:24: error: 'a' was not declared in this scope
    9 |                 cin >> a[i];
      |                        ^
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

signed main() {
	int a;
	cin >> a;
	int b, c, d; b=INT_MAX; c = d = 0;
	for (int e = 0; e < a; e++) {
		int f;
		cin >> f;
		d += f;
		b = min(b, f);
		c = max(c, f);
	}
	cout << b <<" "<< c << " " << d << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: 'INT_MAX' was not declared in this scope
   10 |         int b, c, d; b=INT_MAX; c = d = 0;
      |                        ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include<algorithm>
  +++ |+#include <climits>
    5 | using namespace std;
Language: C++

#include <iostream>
#include <vector>
#include <numeric>
using namespace std;

int main(void){
    std::vector<int> vec(10000);
    int n, min, max, sum;
    
    for(i = 0; i<n; i++){
        sin >> vec[i];
    }
    
    int min = *std::min_element(vec.begin(), vec.end());
    int max = *std::max_element(vec.begin(), vec.end());
    
    int sum = std::accumulate(v.begin(), v.end(), 0 );
    
    cout << min << " " << max << " " << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'i' was not declared in this scope
   10 |     for(i = 0; i<n; i++){
      |         ^
a.cc:11:9: error: 'sin' was not declared in this scope; did you mean 'min'?
   11 |         sin >> vec[i];
      |         ^~~
      |         min
a.cc:14:9: error: redeclaration of 'int min'
   14 |     int min = *std::min_element(vec.begin(), vec.end());
      |         ^~~
a.cc:8:12: note: 'int min' previously declared here
    8 |     int n, min, max, sum;
      |            ^~~
a.cc:14:21: error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'?
   14 |     int min = *std::min_element(vec.begin(), vec.end());
      |                     ^~~~~~~~~~~
      |                     tuple_element
a.cc:15:9: error: redeclaration of 'int max'
   15 |     int max = *std::max_element(vec.begin(), vec.end());
      |         ^~~
a.cc:8:17: note: 'int max' previously declared here
    8 |     int n, min, max, sum;
      |                 ^~~
a.cc:15:21: error: 'max_element' is not a member of 'std'; did you mean 'tuple_element'?
   15 |     int max = *std::max_element(vec.begin(), vec.end());
      |                     ^~~~~~~~~~~
      |                     tuple_element
a.cc:17:9: error: redeclaration of 'int sum'
   17 |     int sum = std::accumulate(v.begin(), v.end(), 0 );
      |         ^~~
a.cc:8:22: note: 'int sum' previously declared here
    8 |     int n, min, max, sum;
      |                      ^~~
a.cc:17:31: error: 'v' was not declared in this scope
   17 |     int sum = std::accumulate(v.begin(), v.end(), 0 );
      |                               ^
Language: C++

let words str =
  let len = String.length str in
  let buf = Buffer.create 8 in
  let rec aux i l =
    if i >= len then List.rev (Buffer.contents buf :: l)
    else 
      match str.[i] with
      | ' ' ->
        let s = Buffer.contents buf in
        Buffer.clear buf;
        aux (i+1) (s :: l)
      | c   ->
        Buffer.add_char buf c;
        aux (i+1) l
  in
  aux 0 []
    
let () =
  let _ = read_int () in
  let nums  = List.map int_of_string (words (read_line ())) in
  let mi = List.fold_left (fun acc n -> min acc n) max_int nums in
  let ma = List.fold_left (fun acc n -> max acc n) min_int nums in
  let sum = List.fold_left (fun acc n -> acc + n) 0 nums in
  print_endline (Printf.sprintf "%d %d %d" mi ma sum)

Compiler output:
a.cc:1:1: error: 'let' does not name a type
    1 | let words str =
      | ^~~
a.cc:11:13: error: expected constructor, destructor, or type conversion before '(' token
   11 |         aux (i+1) (s :: l)
      |             ^
a.cc:14:13: error: expected constructor, destructor, or type conversion before '(' token
   14 |         aux (i+1) l
      |             ^
Language: C++

//
// Created by tac on 2016/10/12.
//

#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <numeric>

int main() {
    int n;
    long a;
    long min, max, sum;

    std::cin >> n;
//    std::vector<long> vec;
//    for (int i = 0; i < n; ++i) {
//        std::cin >> a;
//        vec.push_back(a);
//    }
//    min = *std::min_element(vec.begin(), vec.end());
//    max = *std::max_element(vec.begin(), vec.end());
//    sum = std::accumulate(vec.begin(), vec.end(), 0);
    min = LONG_MAX;
    max = LONG_MIN;
    sum = 0;
    for (int i = 0; i < n; ++i) {
        std::cin >> a;
        if (a < min) {
            min = a;
        }
        if (max < a) {
            max = a;
        }
        sum += a;
    }
    std::cout << min << " " << max << " " << sum << std::endl;
    return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:11: error: 'LONG_MAX' was not declared in this scope
   25 |     min = LONG_MAX;
      |           ^~~~~~~~
a.cc:10:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    9 | #include <numeric>
  +++ |+#include <climits>
   10 | 
a.cc:26:11: error: 'LONG_MIN' was not declared in this scope
   26 |     max = LONG_MIN;
      |           ^~~~~~~~
a.cc:26:11: note: 'LONG_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include<iostream>
#include<algorithm>

int mail(){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
long long sum=0;
for(i=0;i<n;i++){
sum=sum+a[i];
}
int max=a[0];
for(i=1;i<n;i++){
if(max<a[i]) max=a[i];
}
cout<<sum<<" "<<max<<endl;
}

Compiler output:
a.cc: In function 'int mail()':
a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 | cin>>n;
      | ^~~
      | 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:5: error: 'i' was not declared in this scope
   12 | for(i=0;i<n;i++){
      |     ^
a.cc:16:5: error: 'i' was not declared in this scope
   16 | for(i=1;i<n;i++){
      |     ^
a.cc:19:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 | cout<<sum<<" "<<max<<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:19:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 | cout<<sum<<" "<<max<<endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
   20 | }
      | ^
Language: C++

#include<iostream>
 
int main(){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
long long sum=0;
for(i=0;i<n;i++){
sum=sum+a[i];
}
int max=a[0];
for(i=1;i<n;i++){
if(max<a[i]) max=a[i];
}
int min=a[0];
for(i=1;i<n;i++){
if(min>a[i]) min=a[i];
}

cout<<sum<<" "<<max<<" "<<min<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 | cin>>n;
      | ^~~
      | 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:11:5: error: 'i' was not declared in this scope
   11 | for(i=0;i<n;i++){
      |     ^
a.cc:15:5: error: 'i' was not declared in this scope
   15 | for(i=1;i<n;i++){
      |     ^
a.cc:19:5: error: 'i' was not declared in this scope
   19 | for(i=1;i<n;i++){
      |     ^
a.cc:23:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   23 | cout<<sum<<" "<<max<<" "<<min<<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:23:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   23 | cout<<sum<<" "<<max<<" "<<min<<endl;
      |                                ^~~~
      |                                std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;
 
int main(){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
long long sum=0;
for(i=0;i<n;i++){
sum=sum+a[i];
}
int max=a[0];
for(i=1;i<n;i++){
if(max<a[i]) max=a[i];
}
int min=a[0];
for(i=1;i<n;i++){
if(min>a[i]) min=a[i];
}

cout<<sum<<" "<<max<<" "<<min<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'i' was not declared in this scope
   12 | for(i=0;i<n;i++){
      |     ^
a.cc:16:5: error: 'i' was not declared in this scope
   16 | for(i=1;i<n;i++){
      |     ^
a.cc:20:5: error: 'i' was not declared in this scope
   20 | for(i=1;i<n;i++){
      |     ^
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n;
  long long a;
  long long minValue = 1000000;
  long long maxValue = -1000000;
  long long sum = 0;
  cin >> n;

  for (i = 0; i < n; i++) {
    cin >> a;
    if (a < minValue)minValue = a;
    if (a > maxValue)maxValue = a;
    sum += a;
  }
  cout << minValue << " " << maxValue << " " << sum << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'i' was not declared in this scope
   11 |   for (i = 0; i < n; i++) {
      |        ^
Language: C++

n = input()
a = input().split()
s = 0
m = a[0]
M = a[0]
for i in range(0,n):
    s += a[i]
    if m > a[i]:
        s = a[i]
    if M < a[i]
        M = a[i]
print m,M,s

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = input()
      | ^
Language: C++

n = input()
a = map(int,raw_input().split())
s = 0
m = a[0]
M = a[0]
for i in range(0,n):
    s += a[i]
    if m > a[i]:
        s = a[i]
    if M < a[i]
        M = a[i]
print m,M,s

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = input()
      | ^
Language: C++

#include <iostream>
#include <iomanip>
#include <cstdio>
using namespace std;

int main()
{
	int n;
	cin >> n;
	int a[n];
	for(int i = 0;i < n;i++){
		cin >> a[i];
	}
	int min = 1000000,max = -1000000,
	long sum = 0;
	
	for(int i = 0;i < n;i++){
		if(min > a[i]) min = a[i];
		if(max < a[i]) max = a[i];
		sum += a[i];
	}
	
	cout << min << " " << max << " " << sum << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: expected unqualified-id before 'long'
   15 |         long sum = 0;
      |         ^~~~
a.cc:20:17: error: 'sum' was not declared in this scope
   20 |                 sum += a[i];
      |                 ^~~
a.cc:23:45: error: 'sum' was not declared in this scope
   23 |         cout << min << " " << max << " " << sum << endl;
      |                                             ^~~
Language: C++

#include <iostream>
#include <iomanip>
#include <cstdio>
using namespace std;

int main()
{
	long n;
	cin >> n;
	long a[n];
	for(int i = 0;i < n;i++){
		cin >> a[i];
	}
	long min = 1000000,max = -1000000,
	long sum = 0;
	
	for(int i = 0;i < n;i++){
		if(min > a[i]) min = a[i];
		if(max < a[i]) max = a[i];
		sum += a[i];
	}
	
	cout << min << " " << max << " " << sum << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: expected unqualified-id before 'long'
   15 |         long sum = 0;
      |         ^~~~
a.cc:20:17: error: 'sum' was not declared in this scope
   20 |                 sum += a[i];
      |                 ^~~
a.cc:23:45: error: 'sum' was not declared in this scope
   23 |         cout << min << " " << max << " " << sum << endl;
      |                                             ^~~
Language: C++

#include <iostream>
#include <string>
#include <stdio.h>

using namespace std;

int main() {

    int num = 0, min = 1000000, max = -1000000, sum = 0;
    int n;
    cin >> n;
    int* a = new int[n];

    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        if (min > a[i])
            min = a[i];
        if (max < a[i])
            max = a[i];
        sum += a[i];
    }
    cout << min << " " << max " " << sum << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:30: error: expected ';' before string constant
   22 |     cout << min << " " << max " " << sum << endl;
      |                              ^~~~
      |                              ;
Language: C++

#include<bits/stdc++.h>
using namespace std;main(){int n;cin>>n;vector<int>a(n);while(n==-1){cin>>a[n-1];n--;}sort(a.begin(),a.end());cout<<a[0]<<" "<<a[n-1]<<" "<<accumulate(a.begin(),a.end())<<endl;}

Compiler output:
a.cc:2:21: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | using namespace std;main(){int n;cin>>n;vector<int>a(n);while(n==-1){cin>>a[n-1];n--;}sort(a.begin(),a.end());cout<<a[0]<<" "<<a[n-1]<<" "<<accumulate(a.begin(),a.end())<<endl;}
      |                     ^~~~
a.cc: In function 'int main()':
a.cc:2:151: error: no matching function for call to 'accumulate(std::vector<int>::iterator, std::vector<int>::iterator)'
    2 | using namespace std;main(){int n;cin>>n;vector<int>a(n);while(n==-1){cin>>a[n-1];n--;}sort(a.begin(),a.end());cout<<a[0]<<" "<<a[n-1]<<" "<<accumulate(a.begin(),a.end())<<endl;}
      |                                                                                                                                             ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/numeric:62,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_numeric.h:134:5: note: candidate: 'template<class _InputIterator, class _Tp> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp)'
  134 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:134:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_numeric.h:161:5: note: candidate: 'template<class _InputIterator, class _Tp, class _BinaryOperation> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation)'
  161 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:161:5: note:   candidate expects 4 arguments, 2 provided
Language: C++

include <stdio.h>
#include <stdlib.h>
void MMS(int *a,int n){
  int k = a[0];
  int l = a[0];
  int sum = a[0];
  for(int i = 1;i < n;i++){
    if(k < a[i]){
      k = a[i];
    }
    if(l > a[i]){
      l = a[i];
    }
    sum += a[i];
  }
  printf("%d %d %d\n",l,k,sum);
}

int main(void){
    int n,k,i;
    int *a;
    scanf("%d",&n);
    a =(int *)malloc(sizeof(int)*n);
    for(i = 0;i < n;i++){
      scanf("%d",&a[i]);
    }
    MMS(a,n);
    free(a);
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <stdio.h>
      | ^~~~~~~
a.cc: In function 'void MMS(int*, int)':
a.cc:16:3: error: 'printf' was not declared in this scope
   16 |   printf("%d %d %d\n",l,k,sum);
      |   ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include <stdlib.h>
  +++ |+#include <cstdio>
    3 | void MMS(int *a,int n){
a.cc: In function 'int main()':
a.cc:22:5: error: 'scanf' was not declared in this scope
   22 |     scanf("%d",&n);
      |     ^~~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
void MMS(int *a,int n){
  int k = a[0];
  int l = a[0];
  _int64 sum = a[0];
  for(int i = 1;i < n;i++){
    if(k < a[i]){
      k = a[i];
    }
    if(l > a[i]){
      l = a[i];
    }
    sum += a[i];
  }
  printf("%d %d %d\n",l,k,sum);
}

int main(void){
    int n,k,i;
    int *a;
    scanf("%d",&n);
    a =(int *)malloc(sizeof(int)*n);
    for(i = 0;i < n;i++){
      scanf("%d",&a[i]);
    }
    MMS(a,n);
    free(a);
}

Compiler output:
a.cc: In function 'void MMS(int*, int)':
a.cc:6:3: error: '_int64' was not declared in this scope
    6 |   _int64 sum = a[0];
      |   ^~~~~~
a.cc:14:5: error: 'sum' was not declared in this scope
   14 |     sum += a[i];
      |     ^~~
a.cc:16:27: error: 'sum' was not declared in this scope
   16 |   printf("%d %d %d\n",l,k,sum);
      |                           ^~~
Language: C++

#include <string>
#include <iostream>

using namespace std;

int A[10000];

int min(int n)
{
    assert(n>=0);
    if(n == 1)
        return A[0];
    int r = min(n-1);
    return A[n-1] > r ? r : A[n-1];
}
int max(int n)
{
    assert(n>0);
    if(n==1)
        return A[0];
    int r = max(n-1);
    return  A[n-1] > r ? A[n-1] : r;
}
long long sum(int n)
{
    assert(n>=0);
    if(n==1)
        return A[0];
    return  A[n-1] + sum(n-1);
}

int main() {
    int n;
    cin >> n;
    for(int i = 0;i<n;i++)
        cin >> A[i];
    cout << min(n) << " " << max(n) << " " << sum(n) << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int min(int)':
a.cc:10:5: error: 'assert' was not declared in this scope
   10 |     assert(n>=0);
      |     ^~~~~~
a.cc:3:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    2 | #include <iostream>
  +++ |+#include <cassert>
    3 | 
a.cc: In function 'int max(int)':
a.cc:18:5: error: 'assert' was not declared in this scope
   18 |     assert(n>0);
      |     ^~~~~~
a.cc:18:5: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
a.cc: In function 'long long int sum(int)':
a.cc:26:5: error: 'assert' was not declared in this scope
   26 |     assert(n>=0);
      |     ^~~~~~
a.cc:26:5: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
Language: C++

#include <stdio.h>

int main ()


{


int i,n,a[10000];


scanf("%d",&n);


for(i=0;i<n;i++){


scanf("%d",&a[i]);


}


int min=a[0],max=a[0];


long long int sum=0;


for(i=0;i<n;i++){


if(a[i]<min){


min=a[i];


}


else if(a[i]>max){


max=a[i];


}


sum+=a[i];


}


printf("%d %d %lld\n",min,max.sum);


return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:31: error: request for member 'sum' in 'max', which is of non-class type 'int'
   57 | printf("%d %d %lld\n",min,max.sum);
      |                               ^~~
Language: C++

#include <stdio.h>

int main ()


{


int i,n,a[10000];


scanf("%d",&n);


for(i=0;i<n;i++){


scanf("%d",&a[i]);


}


int min=a[0],max=a[0];


long long int sum=0;


for(i=0;i<n;i++){


if(a[i]<min){


min=a[i];


}else if(a[i]>max){


max=a[i];


}


sum+=a[i];


}


printf("%d %d %d\n",min,max.sum);


return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:29: error: request for member 'sum' in 'max', which is of non-class type 'int'
   54 | printf("%d %d %d\n",min,max.sum);
      |                             ^~~
Language: C++

#include <stdio.h>

int main ()


{


int i,n,a[10000];


scanf("%d",&n);


for(i=0;i<n;i++){


scanf("%d",&a[i]);


}


int min=a[0],max=a[0];

int sum=0;


for(i=0;i<n;i++){


if(a[i]<min){


min=a[i];


}else if(a[i]>max){


max=a[i];


}


sum+=a[i];


}


printf("%d %d %d\n",min,max.sum);


return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:29: error: request for member 'sum' in 'max', which is of non-class type 'int'
   53 | printf("%d %d %d\n",min,max.sum);
      |                             ^~~
Language: C++

#include <stdio.h>

int main ()


{


int i,n,a[10000];


scanf("%d",&n);


for(i=0;i<n;i++){


scanf("%d",&a[i]);


}


int min=a[0],max=a[0];

long long int sum=0;


for(i=0;i<n;i++){


if(a[i]<min){


min=a[i];


}


}else if(a[i]>max){


max=a[i];


}


sum+=a[i];


}


printf("%d %d %d\n",min,max.sum);


return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:2: error: 'else' without a previous 'if'
   41 | }else if(a[i]>max){
      |  ^~~~
a.cc: At global scope:
a.cc:56:7: error: expected constructor, destructor, or type conversion before '(' token
   56 | printf("%d %d %d\n",min,max.sum);
      |       ^
a.cc:59:1: error: expected unqualified-id before 'return'
   59 | return 0;
      | ^~~~~~
a.cc:62:1: error: expected declaration before '}' token
   62 | }
      | ^
Language: C++

#include <stdio.h>

int main ()


{


int i,n,a[10000];


scanf("%d",&n);


for(i=0;i<n;i++){


scanf("%d",&a[i]);


}


int min=a[0],max=a[0];

long long int sum=0;


for(i=0;i<n;i++){


if(a[i]<min){


min=a[i];


}


}else if(a[i]>max){


max=a[i];


}


sum+=a[i];


}


printf("%d %d %lld\n",min,max.sum);


return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:2: error: 'else' without a previous 'if'
   41 | }else if(a[i]>max){
      |  ^~~~
a.cc: At global scope:
a.cc:56:7: error: expected constructor, destructor, or type conversion before '(' token
   56 | printf("%d %d %lld\n",min,max.sum);
      |       ^
a.cc:59:1: error: expected unqualified-id before 'return'
   59 | return 0;
      | ^~~~~~
a.cc:62:1: error: expected declaration before '}' token
   62 | }
      | ^
Language: C++

#include <stdio.h>

int main ()


{


int i,n,a[10000];


scanf("%d",&n);


for(i=0;i<n;i++){


scanf("%d",&a[i]);


}


int min=a[0],max=a[0];

long long int sum=0;


for(i=0;i<n;i++){


if(a[i]<min){


min=a[i];


}else if(a[i]>max){


max=a[i];


}


sum+=a[i];


}


printf("%d %d %lld\n",min,max.sum);


return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:31: error: request for member 'sum' in 'max', which is of non-class type 'int'
   53 | printf("%d %d %lld\n",min,max.sum);
      |                               ^~~
Language: C++

#include <stdio.h>

int main ()


{


int i,n,a[10000];


scanf("%d",&n);


for(i=0;i<n;i++){


scanf("%d",&a[i]);


}


int min=a[0],max=a[0];

long long int sum=0;


for(i=0;i<n;i++){


if(a[i]<min){


min=a[i];


}elseif(a[i]>max){


max=a[i];


}


sum+=a[i];


}


printf("%d %d %lld\n",min,max.sum);


return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:2: error: 'elseif' was not declared in this scope
   38 | }elseif(a[i]>max){
      |  ^~~~~~
a.cc:53:31: error: request for member 'sum' in 'max', which is of non-class type 'int'
   53 | printf("%d %d %lld\n",min,max.sum);
      |                               ^~~
Language: C++

#include <iostream>
using namespace std;

int main(void) {
    int N, inputNum;
    int min = 1000000;
    int max = ???1000001;
    int sum = 0;

    cin >> N;

    while(N-- > 0) {
        cin >> inputNum;
        if(max < inputNum)
            max = inputNum;
        if(min > inputNum)
            min = inputNum;
        sum += inputNum;
    }

    cout << min << " " << max << " " << sum << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: expected primary-expression before '?' token
    7 |     int max = ???1000001;
      |               ^
a.cc:7:16: error: expected primary-expression before '?' token
    7 |     int max = ???1000001;
      |                ^
a.cc:7:17: error: expected primary-expression before '?' token
    7 |     int max = ???1000001;
      |                 ^
a.cc:7:25: error: expected ':' before ';' token
    7 |     int max = ???1000001;
      |                         ^
      |                         :
a.cc:7:25: error: expected primary-expression before ';' token
a.cc:7:25: error: expected ':' before ';' token
    7 |     int max = ???1000001;
      |                         ^
      |                         :
a.cc:7:25: error: expected primary-expression before ';' token
a.cc:7:25: error: expected ':' before ';' token
    7 |     int max = ???1000001;
      |                         ^
      |                         :
a.cc:7:25: error: expected primary-expression before ';' token
Language: C++

#include <stdio.h>
  
int main(){
   int i, n, max, min, sum;
   c=0;
   scanf("%d",&n);
   int a[10000];
   for(i=0;i < n;i++){
       scanf("%d",&a[i]);
   }
   max=i[0];
   min=i[0];
   sum=0;
   for(i=0;i < n;i++){
      if(max < i[n]){
         max=i[n];
      }
      if(min > i[n]){
         min=i[n];
      }
      sum=sum+i[n];
   }
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:4: error: 'c' was not declared in this scope
    5 |    c=0;
      |    ^
a.cc:11:9: error: invalid types 'int[int]' for array subscript
   11 |    max=i[0];
      |         ^
a.cc:12:9: error: invalid types 'int[int]' for array subscript
   12 |    min=i[0];
      |         ^
a.cc:15:17: error: invalid types 'int[int]' for array subscript
   15 |       if(max < i[n]){
      |                 ^
a.cc:16:15: error: invalid types 'int[int]' for array subscript
   16 |          max=i[n];
      |               ^
a.cc:18:17: error: invalid types 'int[int]' for array subscript
   18 |       if(min > i[n]){
      |                 ^
a.cc:19:15: error: invalid types 'int[int]' for array subscript
   19 |          min=i[n];
      |               ^
a.cc:21:16: error: invalid types 'int[int]' for array subscript
   21 |       sum=sum+i[n];
      |                ^
Language: C++

#include <stdio.h>
  
int main(){
   int i, n, max, min, sum;
   scanf("%d",&n);
   int a[10000];
   for(i=0;i < n;i++){
       scanf("%d",&a[i]);
   }
   max=i[0];
   min=i[0];
   sum=0;
   for(i=0;i < n;i++){
      if(max < i[n]){
         max=i[n];
      }
      if(min > i[n]){
         min=i[n];
      }
      sum=sum+i[n];
   }
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: invalid types 'int[int]' for array subscript
   10 |    max=i[0];
      |         ^
a.cc:11:9: error: invalid types 'int[int]' for array subscript
   11 |    min=i[0];
      |         ^
a.cc:14:17: error: invalid types 'int[int]' for array subscript
   14 |       if(max < i[n]){
      |                 ^
a.cc:15:15: error: invalid types 'int[int]' for array subscript
   15 |          max=i[n];
      |               ^
a.cc:17:17: error: invalid types 'int[int]' for array subscript
   17 |       if(min > i[n]){
      |                 ^
a.cc:18:15: error: invalid types 'int[int]' for array subscript
   18 |          min=i[n];
      |               ^
a.cc:20:16: error: invalid types 'int[int]' for array subscript
   20 |       sum=sum+i[n];
      |                ^