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

#include <iostream>
#include <vector>
#include <bitset>
#include <algorithm>

int main(){
   int N;
   std::cin >> N;
   std::vector<int> s(N);
   for (int i=0; i<N; ++i){
      std::cin >> s.at(i);
   }
   int max = 0;
   for (int i=0; i<(1<<N)-1); i++){
      std::bitset<100> b(i);
      //std::cerr << b << std::endl;
      std::string bs = b.to_string();
      std::reverse(bs.begin(), bs.end());
      std::string bss = bs.substr(0, N);
      //std::cerr << bss << std::endl;
      int tmp = 0;
      for (int j=0; j<bss.size(); j++){
         if (bss.at(j) == '1'){
            tmp = tmp + s.at(j);
         }
      }
      if (tmp % 10 != 0){
         max = std::max(tmp, max);
      }
   }
   std::cout << max << std::endl;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:28: error: expected ';' before ')' token
   14 |    for (int i=0; i<(1<<N)-1); i++){
      |                            ^
      |                            ;
a.cc:14:31: error: 'i' was not declared in this scope
   14 |    for (int i=0; i<(1<<N)-1); i++){
      |                               ^
Language: Java

 public class Main {
 
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int sum = 0;
		List<Integer> point = new ArrayList<>();
		for (int i = 0; i < N; i++) {
			int p = sc.nextInt();
			sum += p;
			if (p%10 != 0) {
				point.add(p);
			}
		}
		if (point.size() == 0) {
			System.out.println(0);
		} else {
			Collections.sort(point);
			System.out.println(sum%10 == 0 ? sum - point.get(0) : sum);
		}
	}
}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
		List<Integer> point = new ArrayList<>();
		^
  symbol:   class List
  location: class Main
Main.java:7: error: cannot find symbol
		List<Integer> point = new ArrayList<>();
		                          ^
  symbol:   class ArrayList
  location: class Main
Main.java:18: error: cannot find symbol
			Collections.sort(point);
			^
  symbol:   variable Collections
  location: class Main
5 errors
Language: C++

#include<algorithm>//sort(all(変数),greater<型名>())で降順に、*max_element(all(変数))で最大値を獲得
#include<bits/stdc++.h>
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric>
// xとyのgcdは__gcd(x,y),xとyのlcmは(x*y)/__gcd、accumulate(all(変数),0)で要素の全加算
#include<queue>//priority_queue<型名> 変数
#include<set>
#include<stack>
#include<string>//変数.substr(どこから,いくつ)
#include<vector>
#define rep(i,n)  for(ll i=0; i<n; i++)
#define rrep(i,n) for(ll i=n-1; 0<=i; i--)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define INF 1e9
using ll = long long;
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main(){
  int n; cin >> n;
  vi s(n); rep(i,n) cin >> s[i];
  int sum = accumulate(all(s),0);
  sort(all(s));
  for(int i = 0; sum % 10 == 0; i++){
    if((sum-s[i])%10!=0) sum -= sum[i];
    if(i == n){
      sum = 0;
      break;
    }
  }
  cout << sum;
  cout << "\n";
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:36: error: invalid types 'int[int]' for array subscript
   33 |     if((sum-s[i])%10!=0) sum -= sum[i];
      |                                    ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <set> 
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i=0;i < (int)(n);i++)

bool dp[2][10001];
 
int main(){
  int n;
  cin >> n;
  dp[0][0] = true;
  dp[1][0] = true;
  int one = 0;
  int two = 1;
  for (int i = 0; i < n;i++){
    int tmp;
    cin >> tmp;
    for (int j = 0; j < 10001;j++){
      if (j+tmp <= 10000 && dp[one][j]) {
        dp[two][j+tmp] = true;
        dp[two][j] = true;
    }
    swap(one,two);
  }
  int ans = 0;
  for (int i = 0; i < 10001;i++){
    if (i%10 != 0 && dp[one][i]) ans = i;
  }
  cout << ans << endl;
  
  
  return 0; 
}



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

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    int n;
    cin >> n;
    vector<int> s(n);
    for(int i =0;i < n;i++){
        cin >> s[i];
    }
    sort(s.begin(),s.end());
    int ans = 0;
    for(int i =0;i < n;i++){
        ans += s[i];
    }
    int count =0;
    while(ans%10 == 0){
        while(s[count] % 10 == 0){
            count++;
            if(count == n){
                ans = 0;
              　break;
            }
        }
        if(count != n){
            ans -= s[count];
        }        
    }
    cout << ans << endl;
}


Compiler output:
a.cc:23:15: error: extended character 　 is not valid in an identifier
   23 |               　break;
      |               ^
a.cc: In function 'int main()':
a.cc:23:15: error: '\U00003000break' was not declared in this scope
   23 |               　break;
      |               ^~~~~~~
Language: Java

import java.util.*;

public class Main{
	
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
  	int n=sc.nextInt(),max=0,sum=0;
    int[] s=new int[n];
    for(int i=0;i<n;i++){
      s[i]=sc.nextInt();
    }
    for(double i=0;i<(1<<(double)n);i++){
      for(int j=0;j<n;j++){
        if((1&i>>j)==1){
          sum+=s[j];
        }
      }
      if(sum%10==0){
        sum=0;
      }
      max=Math.max(max,sum);
      sum=0;
    }
    System.out.println(max);
          
  }
}


Compiler output:
Main.java:12: error: bad operand types for binary operator '<<'
    for(double i=0;i<(1<<(double)n);i++){
                       ^
  first type:  int
  second type: double
Main.java:14: error: bad operand types for binary operator '>>'
        if((1&i>>j)==1){
               ^
  first type:  double
  second type: int
2 errors
Language: C

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    vector<int> s(n);
    for(int i=0; i<n; ++i)cin>>s[i];

    sort(s.begin(),s.end());
    int sum = accumulate(s.begin(),s.end(),0);

    if(sum%10) {
        cout << sum << endl;
        return 0;
    }

    for (int i=0; i<n; ++i) {
        if(s[i]%10){
            cout << sum-s[i] << endl;
            return 0;
        }
    }

    cout << 0 << endl;
    return 0;
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
#define max(a, b) ((a)<(b) ? (b) : (a))
#define swap(type, x, y) do{ type t = x; x = y; y = t; }while(0)
int ans = 0;

void quick(int array[], int left, int right){
  int pl = left, pr = right, x = array[(left + right) / 2];
  do{
    while(array[pl] < x)  pl++;
    while(array[pr] > x)  pr--;
    if(pl <= pr){
      swap(int, array[pl], array[pr]);
      pl++, pr--;
    }
  }while(pl <= pr);
  if(pl < right)  quick(array, pl, right);
  if(pr > left)  quick(array, left, pr);
}

int main(){
  int n;  scanf("%d", &n);h
  int s[103] = {0};
  int not[104] = {0};
  for(int i=1; i<=n; i++){
    scanf("%d", &s[i]);
    ans += s[i];
    if(s[i] % 10)
      not[++not[0]] = s[i];
  }
  quick(not, 1, not[0]);
  if(ans % 10 == 0)
    ans -= not[1];
    
  printf("%d\n", ans);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:21:27: error: 'h' undeclared (first use in this function)
   21 |   int n;  scanf("%d", &n);h
      |                           ^
main.c:21:27: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:28: error: expected ';' before 'int'
   21 |   int n;  scanf("%d", &n);h
      |                            ^
      |                            ;
   22 |   int s[103] = {0};
      |   ~~~                       
main.c:25:18: error: 's' undeclared (first use in this function)
   25 |     scanf("%d", &s[i]);
      |                  ^
Language: C

#include <stdio.h>
#define max(a, b) ((a)<(b) ? (b) : (a))
#define swap(type, x, y) do{ type t = x; x = y; y = t; }while(0)
int ans = 0;

void quick(int array, int left, int right){
  int pl = left, pr = right, x = array[(left + right) / 2];
  do{
    while(array[pl] < x)  pl++;
    while(array[pr] > x)  pr--;
    if(pl <= pr){
      swap(int, array[pl], array[pr]);
      pl++, pr--;
    }
  }while(pl <= pr);
  if(pl < right)  quick(array, pl, right);
  if(pr > left)  quick(array, left, pr);
}

int main(){
  int n;  scanf("%d", &n);
  int s[103] = {0};
  int not[104] = {0};
  for(int i=1; i<=n; i++){
    scanf("%d", &s[i]);
    ans += s[i];
    if(s[i] % 10)
      not[++not[0]] = s[i];
  }
  quick(not, 1, not[0]);
  if(ans % 10 == 0)
    ans -= not[1];
    
  printf("%d\n", ans);
  return 0;
}


Compiler output:
main.c: In function 'quick':
main.c:7:39: error: subscripted value is neither array nor pointer nor vector
    7 |   int pl = left, pr = right, x = array[(left + right) / 2];
      |                                       ^
main.c:9:16: error: subscripted value is neither array nor pointer nor vector
    9 |     while(array[pl] < x)  pl++;
      |                ^
main.c:10:16: error: subscripted value is neither array nor pointer nor vector
   10 |     while(array[pr] > x)  pr--;
      |                ^
main.c:12:22: error: subscripted value is neither array nor pointer nor vector
   12 |       swap(int, array[pl], array[pr]);
      |                      ^
main.c:3:39: note: in definition of macro 'swap'
    3 | #define swap(type, x, y) do{ type t = x; x = y; y = t; }while(0)
      |                                       ^
main.c:12:22: error: subscripted value is neither array nor pointer nor vector
   12 |       swap(int, array[pl], array[pr]);
      |                      ^
main.c:3:42: note: in definition of macro 'swap'
    3 | #define swap(type, x, y) do{ type t = x; x = y; y = t; }while(0)
      |                                          ^
main.c:12:33: error: subscripted value is neither array nor pointer nor vector
   12 |       swap(int, array[pl], array[pr]);
      |                                 ^
main.c:3:46: note: in definition of macro 'swap'
    3 | #define swap(type, x, y) do{ type t = x; x = y; y = t; }while(0)
      |                                              ^
main.c:12:33: error: subscripted value is neither array nor pointer nor vector
   12 |       swap(int, array[pl], array[pr]);
      |                                 ^
main.c:3:49: note: in definition of macro 'swap'
    3 | #define swap(type, x, y) do{ type t = x; x = y; y = t; }while(0)
      |                                                 ^
main.c: In function 'main':
main.c:30:9: error: passing argument 1 of 'quick' makes integer from pointer without a cast [-Wint-conversion]
   30 |   quick(not, 1, not[0]);
      |         ^~~
      |         |
      |         int *
main.c:6:16: note: expected 'int' but argument is of type 'int *'
    6 | void quick(int array, int left, int right){
      |            ~~~~^~~~~
Language: C

#include <stdio.h>
#define max(a, b) ((a)<(b) ? (b) : (a))

int ans = 0;

void quick(int array, int left, int right){
  int pl = left, pr = right, x = array[(left + right) / 2];
  do{
    while(array[pl] < x)  pl++;
    while(array[pr] > x)  pr--;
    if(pl <= pr){
      swap(int, array[pl], array[pr]);
      pl++, pr--;
    }
  }while(pl <= pr);
  if(pl < right)  quick(array, pl, right);
  if(pr > left)  quick(array, left, pr);
}

int main(){
  int n;  scanf("%d", &n);
  int s[103] = {0};
  int not[104] = {0};
  for(int i=1; i<=n; i++){
    scanf("%d", &s[i]);
    ans += s[i];
    if(s[i] % 10)
      not[++not[0]] = s[i];
  }
  quick(not, 1, not[0]);
  if(ans % 10 == 0)
    ans -= not[1];
    
  printf("%d\n", ans);
  return 0;
}


Compiler output:
main.c: In function 'quick':
main.c:7:39: error: subscripted value is neither array nor pointer nor vector
    7 |   int pl = left, pr = right, x = array[(left + right) / 2];
      |                                       ^
main.c:9:16: error: subscripted value is neither array nor pointer nor vector
    9 |     while(array[pl] < x)  pl++;
      |                ^
main.c:10:16: error: subscripted value is neither array nor pointer nor vector
   10 |     while(array[pr] > x)  pr--;
      |                ^
main.c:12:7: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
   12 |       swap(int, array[pl], array[pr]);
      |       ^~~~
main.c:12:12: error: expected expression before 'int'
   12 |       swap(int, array[pl], array[pr]);
      |            ^~~
main.c: In function 'main':
main.c:30:9: error: passing argument 1 of 'quick' makes integer from pointer without a cast [-Wint-conversion]
   30 |   quick(not, 1, not[0]);
      |         ^~~
      |         |
      |         int *
main.c:6:16: note: expected 'int' but argument is of type 'int *'
    6 | void quick(int array, int left, int right){
      |            ~~~~^~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define vout(x) rep(i,x.size()) cout << x[i] << " "
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;
const int mod = 1e9+7;

int main() {
    int n; cin >> n;
    vint s;
    int sum = 0;
    rep(i,n) {
        int x; cin >> x;
        if (x % 10 != 0) s.push_back(x);
        sum += x;
    }
    sort(all(s));
    if (sum % 10 != 0) {
        cout << sum << endl;
        return 0;
    } else {
        if (s.size() != 0) {
            cout << sum - s[0] << endl;
            return 0;
        } else {
            cout << 0 << endl;
            return 0;
        }
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:42:6: error: expected '}' at end of input
   42 |     }
      |      ^
a.cc:21:12: note: to match this '{'
   21 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
    int N;
    cin>>N;
    int ans=0;
    vector<int> s(N,0);
    int mini=100;
    for (int i=0;i<N;i++){
        cin>>s[i];
        ans+=s[i];
        if (s[i]%10!=0){
            mini=min(mini,s[i]);
        }
    }
    if (ans%10==0){
        ans-=mini;
        if (mini==100)ans=0;
    }
    cout << ans endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:16: error: expected ';' before 'endl'
   21 |     cout << ans endl;
      |                ^~~~~
      |                ;
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i=0;i<n;++i) cin >> a[i];

  sort(a.begin(),a.end());
  int ans=0;
  for (int i=0;i<n;++i){
    ans+=a[i];
  }

  if (ans%10!=0) cout << ans << endl;
  else {
    if (a[i]!=0){
      ans-=a[0];
    }
    cout << ans << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: 'i' was not declared in this scope
   18 |     if (a[i]!=0){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int sum=0;
  int ara[n+5];
  for(int i=0;i<n;i++)cin>>ara[i],sum+=ara[i];
  if(sum%10==0)
  {
    sort(ara,ara+n);
    bool f=true;
    for(int i=0;i<n;i++)
    {
      if((sum-ara[i])%10)
      {
        sum-=ara[i];
        cout<<sum<<endl;
        f=false;
        break
      }
    }
    if(f)cout<<0<<endl;
  }
  else cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:14: error: expected ';' before '}' token
   21 |         break
      |              ^
      |              ;
   22 |       }
      |       ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector<pair<int,int>S(N);
  int sum=0;
  for(int i=0;i<N;i++){
    cin>>S.at(i).first;
    if(S.at(i).first%10==0){
      S.at(i).second=1;
    }
    else{
      S.at(i).second=0;
    }
    sum=sum+S.at(i).first;
  }
  if(sum%10!=0){
    cout<<sum<<endl;
  }
  else{
    vector<int>SS;
    for(int i=0;i<N;i++){
      if(S.at(i).second==0){
        SS.push_back(S.at(i).first);
      }
    }
    if(SS.size()==0){
      cout<<0<<endl;
    }
    else{
      sort(SS.begin(),SS.end());
      cout<<sum-SS.at(0)<<endl;
    }
  }
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:26: error: template argument 1 is invalid
    6 |   vector<pair<int,int>S(N);
      |                          ^
a.cc:6:26: error: template argument 2 is invalid
a.cc:9:10: error: 'S' was not declared in this scope
    9 |     cin>>S.at(i).first;
      |          ^
a.cc:24:10: error: 'S' was not declared in this scope
   24 |       if(S.at(i).second==0){
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> scores(n);
  int sum = 0;
  rep(i, n) {
    cin >> scores[i];
    sum += scores[i];
  }
  sort(scores.begin(), scores.end());
  if (sum % 10 == 0) {
    for (auto it = scores.begin(); it != scores.end(); it++) {
      if (*it % 10 != 10) {
        sum -= *it;
        break;
      }
    }
  }

  if (sum % 10 == 0) {
    cout << 0 << endl;
  } else {
    cout << sum << endl;
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   rep(i, n) {
      |       ^
a.cc:9:3: error: 'rep' was not declared in this scope
    9 |   rep(i, n) {
      |   ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

using ll=long long;
const ll MOD=1000000007;

int main() {
  int n,sum=0;
  cin >> n;
  vector<int> s(n);
  for(int i=0;i<n;i++){
    cin >> s[i];
  }
  sort(s.begin(),s.end());
  for(int i=0;i<n;i++){
    sum +=s[i];
  }
  if(sum%10==0){
    for(int i=0;i<n;i++){
      sum -=s[i];
      if(sum%10!=0)
        break;
      else
        sum +=s[i];
    }
    if(i==n-1)
      sum=0;
  }
  cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:8: error: 'i' was not declared in this scope
   26 |     if(i==n-1)
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  int n;cin>>n;
  int an[n]; rep(i,n)cin>>an[i];
  int s=0;rep(i,n) s+= an[i];
  sort(an, an+n);
  rep(i,n) {
    if (s%10!=0) break;
    if (an[i]%10!=0) {
      s-=an[i];
      break
    }
  }
  cout << s;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: expected ';' before '}' token
   14 |       break
      |            ^
      |            ;
   15 |     }
      |     ~
Language: C++

#include<iostream>
#include<string>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)

int main(){
    int n;
    cin >> n;
    int s[n];
    rep(i, n) cin >> s[i];
    sort(s, s + n);
    int ans = 0;
    rep(i, n) ans += s[i];
    if(ans % 10 != 0){
        cout << ans << endl;
        return 0;
    }else{
        rep(i, n){
            if(s[i] % 10 != 0){
                cout << ans - s[i] << endl;
                return 0;
            }
        }
        cout << 0 << endl;
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |     sort(s, s + n);
      |     ^~~~
      |     short
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    Integer n = scan.nextInt();
    int[] a = new int[n];
    for(int i = 0 ; i < n ; i++){
      a[i] = sc.nextInt();
    }
    int sum = 0;
    for(int i = 0 ; i < n ; i++){
      sum += a[i];
    }
    Arrays.sort(a);
    if(sum % 10 == 0) {
      for(int i = 0 ; i < n ; i++) {
        if((sum - a[i]) % 10 == 0){
          continue;
        }
        System.out.println(sum - a[i]);
        return;
      }
    } else {
      System.out.println(sum);
      return;
    }
    System.out.println(0);
  }
}

Compiler output:
Main.java:9: error: cannot find symbol
      a[i] = sc.nextInt();
             ^
  symbol:   variable sc
  location: class Main
1 error
Language: Java


import kotlin.collections.unsigned.UArraysKt;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Main {
    public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int n = scanner.nextInt();

        int sum = 0;
        final List<Integer> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            final int s = scanner.nextInt();
            sum += s;
            list.add(s);
        }

        list.sort(Comparator.comparingInt(Integer::intValue));
        if (sum % 10 != 0) {
            System.out.println(sum);
        } else {
            for (final int value : list) {
                if (value % 10 != 0) {
                    System.out.println(sum - value);
                    return;
                }
            }
            System.out.println(0);
        }
    }
}


Compiler output:
Main.java:2: error: package kotlin.collections.unsigned does not exist
import kotlin.collections.unsigned.UArraysKt;
                                  ^
1 error
Language: C++

#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include <functional>
#include<time.h>
#include <stack>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define ll long long
#define llint long long int
#define sort(s) sort(s.begin(),s.end())
#define reverse(v)  reverse(v.begin(), v.end());
#define Yes(ans) if(ans)cout<<"Yes"<<endl; else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl; else cout<<"NO"<<endl;
#define hei(a) vector<a>
#define whei(a) vector<vector<int>>
constexpr auto mod = 1000000007;


//2のn乗を求めるよ！！！
int ni(int n) {
	if (n == 0)return 1;
	int x = ni(n / 2);
	x *= x;
	if (n % 2 == 1)x *= 2;
	return x;
}

//フィボナッチ数列のx番目を求めるよ！
int f(int x, vector<int> s) {
	if (x == 0)return 0;
	if (x == 1)return 1;
	if (s[x] != 0)return s[x];
	s[x] = f(x - 1, s) + f(x - 2, s);
	return s[x];
}

//aとｂの最大公約数を求めるよ！
llint gcd(llint a, llint b) {
	if (a < b)swap(a, b);
	if (b == 0)return a;
	return gcd(b, a % b);
}



// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

// mod. m での a の逆元 a^{-1} を計算するよ！
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}


//aCbをmod.mで割った余りを求める
ll int c(ll int a, ll int b, ll int m) {
	ll int ans = 1;
	for (ll int i = 0; i < b; i++) {
		ans *= a - i;
		ans %= m;
	}
	for (ll int i = 1; i <= b; i++) {
		ans *= modinv(i, m);
		ans %= m;
	}
	return ans;
}

//m進数のn桁を全列挙やで
void dfs(int m, int n) {

	stack<string> st;
	st.push("");
	while (!st.empty()) {
		string now = st.top();
		st.pop();
		if (now.size() == n) {
			cout << now << endl;
		}
		else {
			for (int i = m - 1; i >= 0; i--) {
				string next = now + to_string(i);
				st.push(next);
			}
		}
	}
}

int main() {
	int n;
	int sum = 0;
	cin >> n;
	hei(int) s(n);
	rep(i, 0, n) {
		cin >> s[i];
		sum += s[i];
	}

		sort(s);
		rep(i, 0, n) {
			if ((sum - s[i]) % 10 != 0&&(sum%10==0))sum -= s[i];
		}
		if (sum % 10 == 0)sum = 0;
	}
	cout << sum << endl;



	return 0;
}

Compiler output:
a.cc:130:9: error: 'cout' does not name a type
  130 |         cout << sum << endl;
      |         ^~~~
a.cc:134:9: error: expected unqualified-id before 'return'
  134 |         return 0;
      |         ^~~~~~
a.cc:135:1: error: expected declaration before '}' token
  135 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

int main()
{
  	int n;
  	cin>>n;
  	int s[n];
  	ll sum = 0;
  	for(int i = 0; i < n; i++)
    {
      	cin>>s[i];
  		sum += s[i];
    }
  	if(sum % 10 == 0)
    {
      	bool all = true;
    	for(int i = 0; i < n; i++)
        {
          	if(s[i] % 10 != 0)
            {
              	all = false;
      			break;
            }
        }
      	if(all)
          	cout<<0;
      	else
        {
          	ll res = INT_MIN;
        	for(int i = 0; i < n; i++)
            {
            	int t = sum - s[i];
              	if(t % 10 == 0)
                  	continue;
              	res = max(t, res);
            }
        }
    }
  	else
      	cout<<sum;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:26: error: no matching function for call to 'max(int&, ll&)'
   37 |                 res = max(t, res);
      |                       ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:37:26: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   37 |                 res = max(t, res);
      |                       ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:37:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   37 |                 res = max(t, res);
      |                       ~~~^~~~~~~~
Language: C++

#include <iostream>
using namespace std;
int main() {
  int n;
  cin >> n;
  int res[10] = {};
  for (int i = 0; i < n; ++i) {
    int nr[10] = {};
    int t;
    cin >> t;
    nr[t % 10] = res[0] + t;
    for (int j = 0; j < 10; ++j) {
      if (j == 0 || res[j]) {
        nr[(t + j) % 10] = res[j] + t;
      }
    }
    res = nr;
  }
  res[0] = 0;
  int ans(0);
  for (const int& i: res) ans = max(ans, i);
  cout << ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: invalid array assignment
   17 |     res = nr;
      |     ~~~~^~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n, su=0, i;
  cin >> n;
  int s[n];
  for(i=0; i<n; i++){
    cin >> s[i];
    su+=s[i];
  }
  sort(s, s+n);
  if(su%10!=0){
    cout << su << endl;
    return 0;
  }
  for(i=0; i<n; i++)
    if(s[i]%10!=0){
      cout << su-s[i] << endl;
      return 0;
    }
  cout << 0 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(s, s+n);
      |   ^~~~
      |   short
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n, su=0;
  cin >> n;
  int s[n];
  for(i=0; i<n; i++){
    cin >> s[i];
    su+=s[i];
  }
  sort(s, s+n);
  if(su%10!=0){
    cout << su << endl;
    return 0;
  }
  for(i=0; i<n; i++)
    if(s[i]%10!=0){
      cout << su-s[i] << endl;
      return 0;
    }
  cout << 0 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i=0; i<n; i++){
      |       ^
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(s, s+n);
      |   ^~~~
      |   short
a.cc:16:7: error: 'i' was not declared in this scope
   16 |   for(i=0; i<n; i++)
      |       ^
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  int s[110];
  bool flag = true;
  int ans = 0;
  int minus;
  for (int i = 0; i < N; i++) {
    cin >> s[i];
    if (s[i] % 10 != 0) flag = false;
    ans += s[i];
  }

  if (flag) {
    cout << 0 << endl;
    return 0;
  }

  sort(s, s + N);

  if (ans % 10 == 0) {
    for (int i = 0; i < N; i++) {
      if ((ans - s[i]) % 10 != 0) {
        ans -= s[i];
        break;
      }
    }
  }

  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   22 |   sort(s, s + N);
      |   ^~~~
      |   short
Language: C++

n = int(input())
score = []
for _ in range(n):
  score.append(int(input()))

score.sort()

total = sum(score)
counter = 0
while total%10 == 0 and counter < len(score):
  total -= score[counter]
  counter += 1;

print(total)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
a.cc:14:6: error: expected constructor, destructor, or type conversion before '(' token
   14 | print(total)
      |      ^
Language: C

#include <stdio.h>

int main() {
    int sum = 0;

    int N;
    scanf("%d", &N);

    int h[N];
    for (int i = 0; i < N; i++) {
        scanf("%d", &S[i]);
    }

    for (int i = 0; i < N; i++) {
        sum += S[i];
    }
    while (sum % 10 == 0 && sum != 0) {
        int sub = 0;

        for (int i = 0; i < N; i++) {
            if (S[i] < S[sub] && S[i] % 10 != 0) {
                sub = i;
            }
        }

        sum -= S[sub];
    }

    printf("%d\n", sum);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:22: error: 'S' undeclared (first use in this function)
   11 |         scanf("%d", &S[i]);
      |                      ^
main.c:11:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,sum=0;
  cin>>N;
  vector<int> S(N);
  for(int i=0;i<N;i++){
    cin>>S.at(i);
    sum+=S.at(i);
    }
  if(sum%10!=0)
    cout<<sum<<endl,;
  else{
    bool flag=true;
    sort(S.begin(),S.end());
    for(int i=0;i<N;i++){
      sum-=S.at(i);
      if(sum%10!=0){
        flag=false;
        cout<<sum<<endl;
        break;
        }
      }
    if(flag)
      cout<<"0"<<endl;
    }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: expected primary-expression before ';' token
   12 |     cout<<sum<<endl,;
      |                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll=long long;

int main(){
  int i,j,cnt;
  int n;
  cin>>n;
  int s[n];
  for(i=0;i<n;i++)cin>>s[i];
  sum=0;
  for(i=0;i<n;i++)sum+=s[i];
  if(sum%10!=0){
    cout<<sum;
    return 0;
  }
  int mi=INT_MAX;
  for(i=0;i<n;i++){
    if(s[i]%10!=0){
      mi=min(mi,s[i]);
    }
  }
  if(mi==INT_MAX)cout<<0;
  else cout<<sum-mi;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'sum' was not declared in this scope
   11 |   sum=0;
      |   ^~~
Language: C++

#include<bits/stdc++.h>
 
using namespace std;
 
 
#define IOS ios::sync_with_stdio(0); cin.tie(0), cout.tie(0)
 
 
#define ll long long int
#define ld long double
 
#define fr first
#define se second
 
 
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(v) (int)v.size()
#define sunq(v) sort(all(v));v.resize(distance(v.begin(),unique(all(v))))
 
 
#define pb push_back
#define mp make_pair
 
 
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define emla(a, val) memset(a, val, sizeof(a))
#define easm(a, b) (a + b - 1) /b 
 
#define PI 3.141592653589793238
 
 
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a*b/gcd(a,b);}

 

//bool valid(int i, int j){return i >= 0 && i < n && j >= 0 && j < m;}

int n, s;
int main() {
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);
  //clock_t z = clock();
  cin >> n;
  while(n--){
    int x;
    cin >> x;
    s += x;
  }
  if(x%10 == 0)cout << 0 << endl;
  else cout << s << endl;
  //debug("Total Time: %.3f\n", (double)(clock() - z) / CLOCKS_PER_SEC);
  /*
  *try tricky test cases:
    -bounds
    -small input (0, 1)
    -big input
    -random tests
  */
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:6: error: 'x' was not declared in this scope
   51 |   if(x%10 == 0)cout << 0 << endl;
      |      ^
Language: C

#include<stdio.h>

void sort(int n, int S[n])
{
    int i, j;
    int tmp;

    for(i = 0; i < n - 1; i ++){
        for(j = n - 1; j > i; j--){
            if(S[j - 1] > S[j]){
                tmp = S[j - 1];
                S[j - 1] = S[j];
                S[j] = tmp;
            }
        }
    }
}

int main()
{
    int n;  scanf("%d", &n);
    int S[n];
    int i;
    int sum = 0;

    for(i = 0; i < n; i++){
        scanf("%d", &S[i]);
        sum += S[i];
    }

    sort(n, S);

    i = 0;
    while(sum % 10 == 0){
        if(S[i] % 10 != 0){
            sum -= S[i];
        }
        i++;
        if(i == n){
            break;
        }
    }



    printf("%d\n", );

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:46:20: error: expected expression before ')' token
   46 |     printf("%d\n", );
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int n,s,sm=0,mn=100;
    cin>>n;
    for (int i=0;i<n;i++) {
        cin>>s;
        sm+=s;
        if (m%10)
            mn=min(mn,s);
    }
    if (sm%10)
        cout<<sm<<endl;
    else if (mn!=100)
        cout<<sm-mn<<endl;
    else
        cout<<0<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'm' was not declared in this scope
   11 |         if (m%10)
      |             ^
Language: C++

#include<cstdio>
#include<algorithm>
using namespace std;
int dp[101][10001];
int main(void){
	int n;
	int box[100];
	int sum;
	int i,j;
	int MAX;
	scanf("%d",&n);
	sum=0;
	for(i=0;i<n;i++){
		scanf("%d",&box[i]);
		sum+=box[i];
	for(i=0;i<=n;i++){
		for(j=0;j<=sum;j++){
			dp[i][j]=0;
		}
	}
	for(i=0;i<n;i++){
		for(j=0;j<=sum;j++){
			//printf("j+box[i]=%d\n",j+box[i]);
			dp[i+1][j+box[i]]=max(dp[i+1][j+box[i]],dp[i][j]+box[i]);
		}
	}
	MAX=0;
	for(i=0;i<=sum;i++)	if(dp[n][i]%10!=0)MAX=max(MAX,dp[n][i]);
	printf("%d\n",MAX);
	return 0;
}

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

#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const ll mod = 1000000007;
const ll INF = mod * mod;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
typedef vector<int> vec;
typedef vector<string> svec;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
//#define int long long

void solve() {
    int N; cin >> N;
    vector<int> s(N);
    int sum = 0;
    set<int> se;
    rep(i, N) {
        cin >> s[i];
        sum += s[i];
        if(s[i] % 10 != 0)se.insert(s[i]);
    }
    if(sum % 10 != 0) {
        cout << sum << endl;
    } else {
        if(se.size() == 0) {
            cout << 0 << endl;
        } else {
            cout << sum - se[0] << endl;
        }
    }

}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//init();
	solve();
	//cout << "finish" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:65:29: error: no match for 'operator[]' (operand types are 'std::set<int>' and 'int')
   65 |             cout << sum - se[0] << endl;
      |                             ^
Language: C++

#include <vector>
#include <algorithm>

using namespace std;

vector<int> v;
int N;

int main(){
    int sum = 0;
    cin >> N;
    v.resize(N);
    for(int i=0;i<N;i++){
        cin >> v[i];
        sum += v[i];
    }
    if(sum % 10 != 0){
        cout << sum << endl;
        return sum;
    }
    sort(v.begin(),v.end());
    for(int i=0;i<N;i++){
        if(v[i] % 10 != 0){
            cout << sum - v[i] << endl;
            return 0;
        }
    }
    cout << 0 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'cin' was not declared in this scope
   11 |     cin >> N;
      |     ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <algorithm>
  +++ |+#include <iostream>
    3 | 
a.cc:18:9: error: 'cout' was not declared in this scope
   18 |         cout << sum << endl;
      |         ^~~~
a.cc:18:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:24: error: 'endl' was not declared in this scope
   18 |         cout << sum << endl;
      |                        ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <algorithm>
  +++ |+#include <ostream>
    3 | 
a.cc:24:13: error: 'cout' was not declared in this scope
   24 |             cout << sum - v[i] << endl;
      |             ^~~~
a.cc:24:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:35: error: 'endl' was not declared in this scope
   24 |             cout << sum - v[i] << endl;
      |                                   ^~~~
a.cc:24:35: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:28:5: error: 'cout' was not declared in this scope
   28 |     cout << 0 << endl;
      |     ^~~~
a.cc:28:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:28:18: error: 'endl' was not declared in this scope
   28 |     cout << 0 << endl;
      |                  ^~~~
a.cc:28:18: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

//  Created by liszt on 2019/07/28.
#include<bits/stdc++.h>
using namespace std;

int main(){
    int n,sum=0,i; cin>>n;
    
    vector<int> s(n),maxim(n);
    
    for(i=0;i<n;i++){
        cin>>s[i];
        sum+=s[i];
    }
    
    if(sum%10!=0){
        cout<<sum<<endl;
        return 0;
    }
    
    for(i=0;i<n;i++){
        maxim.push_back(sum-a[i]);
    }
    
    sort(maxim.begin(),maxim.end());
    
    for(i=n-1;i>=0;i--){
        if(maxim[i]%10!=0){
            cout<<maxim[i]<<endl;
            return 0;
        }
    }
    
    cout<<0<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:29: error: 'a' was not declared in this scope
   21 |         maxim.push_back(sum-a[i]);
      |                             ^
Language: C++

import sys

n = int(input())
s = [int(input()) for i in range(n)]
s.sort()

ans = sum(s)

for i in s:
	if(ans%10==0):
		ans -= i
	else:
		print(ans)
		sys.exit()

print(ans)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C

// うそ
#include<stdio.h>
#include<stdlib.h>

int compare(const void* a, const void*b){
    return *(int*)a - *(int*)b;
}

int main(void){
    int n;
    scanf("%d", &n);
    int s[n];
    int sum = 0;
    for(int i=0; i<n; i++){
        scanf("%d", &s[i]);
        sum += s[i];
    }

    qsort(score, n, sizeof(int), compare);

    int ans;
    int flag = 1;
    if(sum%10 != 0){
        ans = sum;
    }
    else{
        for(int i=0; i<n; i++){
            if((sum-s[i])%10 != 0){
                ans = sum-s[i];
                flag = 0;
                break;
            }
        }
    }

    if(flag){
        printf("%d\n", ans);
    }else{
        printf("0\n");
    }
    // int s[n+1];
    // s[0] = 0;
    // for(int i=1; i<n+1; i++){
    //     s[i] = s[i-1] + score[i-1];
    //     printf("s[%d]:%d\n", i, s[i]);
    // }

    // int ans;
    // for(int i=n; i>=0; i--){
    //     if(s[i]%10 != 0){
    //         ans = s[i];
    //         break;
    //     }
    //     ans = s[i];
    // }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:11: error: 'score' undeclared (first use in this function)
   19 |     qsort(score, n, sizeof(int), compare);
      |           ^~~~~
main.c:19:11: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int>sum(n);
  int sum1=0;
  for(int i=0; i<n; ++i){
    int a=0; 
    cin >> a;
    sum1 += a;
    sum.push_back(sum1);
  }
  for(int i=n-1; i>=0; i--){
    if(sum[i]%10==0){
      continue;}
    else if(sum[i]%10!==0)
    {cout << sum[i] << endl;
      break;}
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:18:24: error: expected primary-expression before '=' token
   18 |     else if(sum[i]%10!==0)
      |                        ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, N) for (int i = 0; i < N; i++)
using namespace std;

int main()
{
    int N;
    cin >> N;
    vector<int> s(N);
    int sum = 0;
    rep(i, N)
    {
        cin >> s[i];
        sum += s[i];
    }
    if (sum % 10 != 0)
    {
        cout << sum << endl;
        return 0;
    }
    sort(s.begin(), s.end());
    else
    {
        rep(i, N)
        {
            if (s[i] % 10 != 0)
            {
                cout << sum - s[i] << endl;
                return 0;
            }
        }
    }
    cout << 0 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:5: error: 'else' without a previous 'if'
   22 |     else
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
  int n,s[n],sum=0; cin>>n;
  for(int i=0;i<n;i++) cin>>s[i]; sum+=s[i];
  if(sum%10==0){
    int t=INT_MAX;
    for(int i=0;i<n;i++){
      if(a[i]%10!=0)t=min(t,a[i]);
    }
    sum-=t;
  }
  cout<<max(0,sum)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:42: error: 'i' was not declared in this scope
    6 |   for(int i=0;i<n;i++) cin>>s[i]; sum+=s[i];
      |                                          ^
a.cc:10:10: error: 'a' was not declared in this scope
   10 |       if(a[i]%10!=0)t=min(t,a[i]);
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  int x = 0;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> a.at(i);
    x += a.at(i);
  }
  sort(a.begin(), a.end());
  
  if(x%10 != 0){
    cout << x << endl;
  }
  
  else {
    int j=0;
    while(a.at(j)%10 == 0 && i<n){
      j++;
    }
    if(a.at(j)%10 == 0){
      a.at(j) = x;
    }
    
    cout << x - a.at(j) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:30: error: 'i' was not declared in this scope
   21 |     while(a.at(j)%10 == 0 && i<n){
      |                              ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define print(s) cout << s << endl
#define acc(v) accumulate(v.begin(), v.end(), 0)
#define cinv(n,v) rep(i,n) cin >> v[i]
using namespace std;
const int INF = 1e9;
typedef long long ll;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vchar;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
// const lint MOD = 998244353;
int x_pos[4] = {1,0,-1,0}, y_pos[4] = {0,1,0,-1};
int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}
char upper(char c){
	return c-0x20;
}
char lower(char c){
	return c+0x20;
}

int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x%y);
}

int lcm(int x, int y){
	int g = gcd(x,y);
	return x/g*y;
}

int facctorialMethod(int k){
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum = (sum%MOD*i%MOD)%MOD;
    }
    return sum;
}

int main(){
	int n; cin >> n;
	int ans = 0, int m = MOD;
	rep(i,n){
		int a; cin >> a;
		s += a;
		if (a%10){
			m = min(m,a);
		}
	}
	if (s%10){
		cout << s << endl;
	}else{
		if (m == MOD){
			cout << 0 << endl;
		}else{
			cout << s - m << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:22: error: expected unqualified-id before 'int'
   52 |         int ans = 0, int m = MOD;
      |                      ^~~
a.cc:55:17: error: 's' was not declared in this scope
   55 |                 s += a;
      |                 ^
a.cc:57:25: error: 'm' was not declared in this scope
   57 |                         m = min(m,a);
      |                         ^
a.cc:60:13: error: 's' was not declared in this scope
   60 |         if (s%10){
      |             ^
a.cc:63:21: error: 'm' was not declared in this scope
   63 |                 if (m == MOD){
      |                     ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void){
  int N;
  cin >> N;
  
  vector<int>num(N,0);
  for(int i=0;i<N;i++){
    cin >> num[i];
  }
  
  sort(num.begun(),num.end());
  
  int sum = 0;
  for(int i=0;i<N;i++){
    sum += num[i];
  }
  
  if(sum % 10 != 0)
    cout << sum << endl;
  else{
    bool all = true;
    for(int i=0;i<N;i++){
      if(num[i] % 10 != 0)
        all = false;
    }
    if(all)
      cout << 0 << endl;
    else{
      for(int i=0;i<N;i++){
        if(num[i] % 10 != 0){
          sum -= num[i];
          break;
        }
      }
        cout << sum << endl;
    }
  }
  
  return 0;
}


    
      

Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: 'class std::vector<int>' has no member named 'begun'; did you mean 'begin'?
   14 |   sort(num.begun(),num.end());
      |            ^~~~~
      |            begin