criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.*;
//https://abc099.contest.atcoder.jp/tasks/abc099_d
public class GoodGrid {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int c = sc.nextInt();
        int[][] wrongness = new int[c][c];
        List<ArrayList<Integer>> colors = new ArrayList<>();
        colors.add(0,new ArrayList<Integer>());
        colors.add(0,new ArrayList<Integer>());
        colors.add(0,new ArrayList<Integer>());
        for (int i = 0; i < wrongness.length; i++) {
            for (int j = 0; j < wrongness.length; j++) {
                wrongness[i][j] = sc.nextInt();
            }
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                colors.get((i + j) % 3).add(sc.nextInt()-1);
            }
        }
        int bestCost = Integer.MAX_VALUE;
        for (int i = 0; i < c; i++) {
            for (int j = 0; j < c; j++) {
                if (i != j) {
                    for (int k = 0; k < c; k++) {
                        if (k != i && k != j) {
                            int cost = 0;
                            for (int l = 0; l < colors.get(0).size(); l++) {
                                cost += wrongness[colors.get(0).get(l)][i];
                            }
                            for (int l = 0; l < colors.get(1).size(); l++) {
                                cost += wrongness[colors.get(1).get(l)][j];
                            }
                            for (int l = 0; l < colors.get(2).size(); l++) {
                                cost += wrongness[colors.get(2).get(l)][k];
                            }
                            bestCost = Math.min(cost, bestCost);
                        }
                    }
                }
            }
        }
        System.out.println(bestCost);
        sc.close();
    }
}


Compiler output:
Main.java:3: error: class GoodGrid is public, should be declared in a file named GoodGrid.java
public class GoodGrid {
       ^
1 error
Language: C++

# 1. 入出力 (二次元配列)

N, C = map(int, input().split())

D = [ list(map(int, input().split())) for _ in range(C) ]
col = [ list(map(int, input().split())) for _ in range(N) ]

ans = 1 << 60
for i in range(C):
    for j in range(C):
        for k in range(C):
            if i == j or j == k or k == i:
                continue

            temp = 0
            lst = [i, j, k]

            for x in range(N):
                for y in range(N):
                    mod = (x + y) % 3
                    temp += D[ col[x][y] - 1 ][ lst[mod] ]

            ans = min(ans, temp)
            # print(lst, temp)

print(ans)

Compiler output:
a.cc:1:3: error: "1." after # is not a positive integer
    1 | # 1. 入出力 (二次元配列)
      |   ^~
a.cc:24:15: error: invalid preprocessing directive #print
   24 |             # print(lst, temp)
      |               ^~~~~
a.cc:3:1: error: 'N' does not name a type
    3 | N, C = map(int, input().split())
      | ^
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    }
    
	//フィールド
    Scanner sc;
    int N;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.nextInt();
    }
    
    //解答処理
    private int solve() {
        int answer = 0;
        
        if (N % 10 == 0) {
        	answer = 10;
        } else {
        	String n = Integer.toString(N);
        	for (int i = 0; i　<　n.length(); i++) {
        		answer += Integer.valueOf(n.substring(i,i+1));
        	}
        	
        }
        
        return answer;
    }
    
    //出力
    public void show(int answer) {
        System.out.println(answer);
    }

}


Compiler output:
Main.java:29: error: illegal character: '\u3000'
        	for (int i = 0; i?<?n.length(); i++) {
        	                 ^
Main.java:29: error: illegal character: '\u3000'
        	for (int i = 0; i?<?n.length(); i++) {
        	                   ^
Main.java:29: error: ';' expected
        	for (int i = 0; i?<?n.length(); i++) {
        	                                   ^
3 errors
Language: C++

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

int main() {
    int N, sumA=0, sumB=0;
    cin >> N;
    for (int A=1; A<N; A++){
     		int B=N-A;
      		int a=A, b=B;
            sumA=0, sumB=0;
            while (true){
              		sumA += a%10;
                    a = (a-a%10)/10;
                    if (a==0) break;
            }
            while (true){
              		sumB += b%10;
                    b = (b-b%10)/10;
              		if (b==0) break;
            }
            if ((Min>sumA+sumB)||A==1){
              		int Min = sumA+sumB;
            }
    }
    cout << Min << endl;
              		
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:18: error: 'Min' was not declared in this scope; did you mean 'sin'?
   22 |             if ((Min>sumA+sumB)||A==1){
      |                  ^~~
      |                  sin
a.cc:23:29: error: redeclaration of 'int Min'
   23 |                         int Min = sumA+sumB;
      |                             ^~~
a.cc:22:18: note: '<typeprefixerror>Min' previously declared here
   22 |             if ((Min>sumA+sumB)||A==1){
      |                  ^~~
a.cc:26:13: error: 'Min' was not declared in this scope; did you mean 'sin'?
   26 |     cout << Min << endl;
      |             ^~~
      |             sin
Language: C++

#include <iostream>
using namespace std;

int Sum_each(int A){
  	int sum = 0, tmp = A;
  	while(1){
      	sum += tmp%10;
      	if(tmp/10 == 0) break;
      	else tmp = tmp/10;
    }
  	return sum;
}

int main(){
  	int N;
  	cin >> N;
  	int min = N;
  	for (int i = 1; i < N; i++){
      	int sum = Sum_each(i)+Sum_each(N-i);
      	if(sum < min) min = sum;
    }
  	cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: 'sum' was not declared in this scope
   22 |         cout << sum << endl;
      |                 ^~~
Language: C++

#include <iostream>
using namespace std;

int Sum_each(int A){
  	int sum = 0, tmp = A;
  	while(1){
      	sum += tmp%10;
      	if(tmp/10 == 0) break;
      	else tmp = tmp/10;
    }
  	return sum;
}

int main(){
  	int N;
  	cin >> N;
  	int min = N;
  	for (int i = 1, i < N, i++){
      	int sum = Sum_each(i)+Sum_each(N-i);
      	if(sum < min) min = sum;
    }
  	cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:26: error: expected ';' before '<' token
   18 |         for (int i = 1, i < N, i++){
      |                          ^~
      |                          ;
a.cc:18:27: error: expected primary-expression before '<' token
   18 |         for (int i = 1, i < N, i++){
      |                           ^
a.cc:18:35: error: expected ';' before ')' token
   18 |         for (int i = 1, i < N, i++){
      |                                   ^
      |                                   ;
a.cc:22:17: error: 'sum' was not declared in this scope
   22 |         cout << sum << endl;
      |                 ^~~
Language: C++

#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using p = pair<int, int>;
typedef vector<int> vi;

// 各桁の合計を求める
int findSumOfDigits(int n) {
  int sum = 0;
  while(n > 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

int main() {
  int n;
  cin >> n;
  int ans = n;

  for (int i = 1; i < n; i++) {
    int a = i;
    int b = n - a;

    int sum_a = findSumOfDigits(a);
    int sum_b = findSumOfDigits(b);
    int sum = sum_a + sum_b;

    ans = min(ans, min);
  }
  cout << ans << endl;


  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:14: error: no matching function for call to 'min(int&, <unresolved overloaded function type>)'
   31 |     ans = min(ans, min);
      |           ~~~^~~~~~~~~~
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:233:5: note: candidate: 'constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = int]'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:36: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to 'const int&'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |                         ~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281: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:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:31:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   31 |     ans = min(ans, min);
      |           ~~~^~~~~~~~~~
Language: C++

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

int findSumOfDigits(int n) {
  int sum = 0;
  while (n > 0) { // n が 0 になるまで
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
int main() {
  int N;
  cin >> N;
  int ans = 9999999;
  for (int i = 1; i <= N-1; i++) {
    if(ans > digit(i) + digit(n-i)){
            ans = digit(i) + digit(n-i);
        }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: 'digit' was not declared in this scope
   17 |     if(ans > digit(i) + digit(n-i)){
      |              ^~~~~
a.cc:17:31: error: 'n' was not declared in this scope
   17 |     if(ans > digit(i) + digit(n-i)){
      |                               ^
Language: C++

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

int findSumOfDigits(int n) {
  int sum = 0;
  while (n > 0) { // n が 0 になるまで
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
int main() {
  int N;
  cin >> N;
  int ans = 9999999;
  for (int i = 1; i <= N-1; i++) {
    int a = digit(i) + digit(N-i);
    ans = min(ans,a);
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'digit' was not declared in this scope
   17 |     int a = digit(i) + digit(N-i);
      |             ^~~~~
Language: C++

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

int findSumOfDigits(int n) {
  int sum = 0;
  while (n > 0) { 
    sum += n % 10;
    n -= a % 10;
    n /= 10;
  }
   sum += n;
  return sum;
}

int main() {
  int N;
  cin >> N;
  int ans = 1000000;
  
  for(int i = 1; i < N-1; i++) {
    int n = findSumOfDigits(i) + findSumOfDigits(N-i);
    ans = min(ans,n);
  }
  cout << ans << endl;
  return 0;
}
    
    
    
    

Compiler output:
a.cc: In function 'int findSumOfDigits(int)':
a.cc:8:10: error: 'a' was not declared in this scope
    8 |     n -= a % 10;
      |          ^
Language: C++

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

int main(){
  int A,B;
  int N;
  int B=N-A;
  
  for(int i;i<100000;i++){
    int s=i%10;i
  
  
  }
  
  
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: redeclaration of 'int B'
    7 |   int B=N-A;
      |       ^
a.cc:5:9: note: 'int B' previously declared here
    5 |   int A,B;
      |         ^
a.cc:10:17: error: expected ';' before '}' token
   10 |     int s=i%10;i
      |                 ^
      |                 ;
......
   13 |   }
      |   ~
Language: C++

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

int SumOfDigits(int a){
  int sum=0;
  while(a>0){
    sum+=a%10;
    a/=10
  }
  return sum;
}
int main() {
  int N;
  cin >> N;
  int result=90;
  for(int i=1;i<N;i++){
    int a=SumOfDigits(i)+SumOfDigits(N-i);
    if(a<result) result=a;
  }
  cout << result << endl;
}


Compiler output:
a.cc: In function 'int SumOfDigits(int)':
a.cc:8:10: error: expected ';' before '}' token
    8 |     a/=10
      |          ^
      |          ;
    9 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
 
int main() {
    int N;
    cin >> N;
    if(N==10||N==100||N==1000||N==10000||N=100000)    cout << 10 << endl;
    else{
        int sum=0;
        while(true){
            if(N/10==0){
                sum+=N;
                break;
            }
            else{
                sum+=N%10;
                N/=10;
            }
            cout << sum << endl;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:40: error: lvalue required as left operand of assignment
   11 |     if(N==10||N==100||N==1000||N==10000||N=100000)    cout << 10 << endl;
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
 
int main() {
    string N;
    cin >> N;
    bool a=false;
    if(N.at(0)=='1')a=true;
    rep(i,N.size()-1){
        if(N.at(i+1)!='0')a=false;
    }
    int sum=0;
    rep(i,N.size(){
        sum+=N.at(i);
    }
    if(a) cout << 10 << endl;
    else cout << sum << endl;
    
}

Compiler output:
a.cc:23:2: error: unterminated argument list invoking macro "rep"
   23 | }
      |  ^
a.cc: In function 'int main()':
a.cc:17:5: error: 'rep' was not declared in this scope
   17 |     rep(i,N.size(){
      |     ^~~
a.cc:17:8: error: expected '}' at end of input
   17 |     rep(i,N.size(){
      |        ^
a.cc:8:12: note: to match this '{'
    8 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
 
int main() {
    string N;
    cin >> N;
    bool a=false;
    if(N.at(0)=='1')a=true;
    rep(i,N.size()-1){
        if(N.at(i+1)!='0')a=false;
    }
    int sum=0;
    rep(i,N.size(){
        sum+=N.at(i);
    })
    if(a) cout << 10 << endl;
    else cout << sum << endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:19: error: expected ')' before '{' token
   17 |     rep(i,N.size(){
      |                   ^
a.cc:2:34: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (int i=0;i<(n);i++)
      |                                  ^
a.cc:2:33: note: to match this '('
    2 | #define rep(i,n) for (int i=0;i<(n);i++)
      |                                 ^
a.cc:17:5: note: in expansion of macro 'rep'
   17 |     rep(i,N.size(){
      |     ^~~
a.cc:2:35: error: expected ';' before ')' token
    2 | #define rep(i,n) for (int i=0;i<(n);i++)
      |                                   ^
a.cc:17:5: note: in expansion of macro 'rep'
   17 |     rep(i,N.size(){
      |     ^~~
a.cc:17:9: error: 'i' was not declared in this scope
   17 |     rep(i,N.size(){
      |         ^
a.cc:2:37: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (int i=0;i<(n);i++)
      |                                     ^
a.cc:21:5: error: 'else' without a previous 'if'
   21 |     else cout << sum << endl;
      |     ^~~~
Language: C++

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

int main() {
    int n;
    cin >> n;
	int t = 0;
	while(n){
		t += n % 10;
		n /= 10;
	}
	if(t == 1){
		cout << 10 << endl;
    }
	else{
		cout<<tot;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:23: error: 'tot' was not declared in this scope
   18 |                 cout<<tot;
      |                       ^~~
Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define uni(e) e.erase(unique(e.begin(),e.end()),e.end())
#define double long double
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int INF=1e10;
int MOD=1e9+7;
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void yesno(T b){if(b)out("yes");else out("no");}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
template<class T> void YESNO(T b){if(b)out("YES");else out("NO");}
template<class T> void noyes(T b){if(b)out("no");else out("yes");}
template<class T> void NoYes(T b){if(b)out("No");else out("Yes");}
template<class T> void NOYES(T b){if(b)out("NO");else out("YES");}
int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
}
int kurai(int a,int b){.
  int m=pow(10,b),n=pow(10,b-1);
  return (a%m)/n;
}
int ketawa(int a){
  int k=0;
  rep(i,keta(a)){
  k+=kurai(a,i+1);
  }
  return k;
}
int gcd(int a,int b){
  if(a%b==0)
    return b;
  return gcd(b,a%b);
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}
int mid(int a,int b,int c){
  vector<int> k(3);
  k[0]=a;k[1]=b;k[2]=c;
  sort(all(k));
  return k[1];
}
bool sosuu(int a){
  bool b=1;
  if(a<=1)
    return 0;
  else{
  rep1(i,sqrt(a)-1){
  if(a%(i+1)==0)
  b=0;
  }
  return b;
  }
}
int modpow(int a,int b,int m=MOD){
	if(!b)return 1;	if(b&1)return modpow(a,b-1,m)*a%m;
	int memo = modpow(a,b>>1,m);
	return memo*memo%m;
}
int fact_mod(int n) {
    int f=1; 
for(int i=2;i<n+1;i++) f=f*(i%MOD)% MOD;
    return f;
}
int mod_pow(int x,int n) {
    int res=1;
    while(n>0){
        if(n&1) res=(res*x)%MOD; 
        x=(x*x)%MOD;        
n>>=1; 
    }
    return res;
}
int c_mod(int n, int r) {
    if(r>n-r) r=n-r;
    if(r==0) return 1;
    int a=1;
    rep(i,r) 
a=a*((n-i)%MOD)%MOD;
    int b=mod_pow(fact_mod(r), MOD-2);
    return (a%MOD)*(b%MOD)%MOD;
}
signed main(){
  int a;
  cin>>a;
  if(ketawa(a)==1)
    out(10);
  else
    out(ketawa(a));
}

Compiler output:
a.cc: In function 'long long int kurai(long long int, long long int)':
a.cc:30:24: error: expected primary-expression before '.' token
   30 | int kurai(int a,int b){.
      |                        ^
a.cc:4:13: error: expected unqualified-id before 'long'
    4 | #define int long long
      |             ^~~~
a.cc:31:3: note: in expansion of macro 'int'
   31 |   int m=pow(10,b),n=pow(10,b-1);
      |   ^~~
a.cc:32:13: error: 'm' was not declared in this scope
   32 |   return (a%m)/n;
      |             ^
a.cc:32:16: error: 'n' was not declared in this scope
   32 |   return (a%m)/n;
      |                ^
Language: C++

#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#define rep(i,n) for (long long i=0; i < (n); ++i)
#define rep2(i,n,m) for(long long i=n;i<=m;i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
ll digsum(ll n) {
    int res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}
int main(){
  ll x ;
  cin >> x ;
  if(digsum(x)=1) cout <<10<<endl ;
  else
   cout<<digsum(x)<<endl; 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: lvalue required as left operand of assignment
   23 |   if(digsum(x)=1) cout <<10<<endl ;
      |      ~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#define rep(i,n) for (long long i=0; i < (n); ++i)
#define rep2(i,n,m) for(long long i=n;i<=m;i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
ll digsum(ll n) {
    int res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}
int main(){
  ll x ;
  cin >> x ;
  if(dihsum(x)=1) cout <<10<<endl ;
  else
   cout<<digsum(x)<<endl; 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:6: error: 'dihsum' was not declared in this scope; did you mean 'digsum'?
   23 |   if(dihsum(x)=1) cout <<10<<endl ;
      |      ^~~~~~
      |      digsum
Language: C

#include <iostream>
using namespace std;
// Se N não é potência de 10, basta escolher um dígito diferente de zero, subtrair um dele e
// gerar o número com 1 na casa decimal correspondente. Por exemplo:
//
//      253 = 252 + 1 = 243 + 10 = 143 + 100
//
// Assim a soma resulta em N e a soma dos dígitos das parcelas é igual a soma dos dígitos de N.
//
// O caso especial acontece quando N é potência de 10, pois há apenas um dígito diferente de zero,
// e este dígito é 1. Neste caso, basta quebrar o número em duas partes iguais a N/2, ou usar
// N/10 e 9*N/10. Ex.:
//
//      1000 = 500 + 500 = 100 + 900
//
// Em ambos casos, a soma dos dígitos das parcelas será igual a 10.
int solve(int N)
{
    int ans = 0;
    do {
        ans += (N % 10);
        N /= 10;
    } while (N);
    return ans == 1 ? 10 : ans;
}
int main()
{
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    auto ans = solve(N);
    cout << ans << '\n';
    return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <bits/stdc++.h>
using namespace std;
int solve(int N)
{
    int ans = 0;
    do {
        ans += (N % 10);
        N /= 10;
    } while (N);
    return ans == 1 ? 10 : ans;
}
int main()
{
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    auto ans = solve(N);
    cout << ans << '\n';
    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int findsum(int n){
int N;
  cin>>N;
 int ans=0;
  while(N>0){
  	ans=ans+N%10;
    N=N/10;
    }
  if(ans ==1){
   ans=10;
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int findsum(int)':
a.cc:15:1: warning: no return statement in function returning non-void [-Wreturn-type]
   15 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
using namespace std;

int main(){
  int n;
  cin>>n;
  
  int s=0,t=0;
  int min=1000;
  
  for(int i=0;i<n;i++){
    while(n>0){
      s+=i%10;
      i/=10;
    }
    
    while(t>0){
      t+=(n-i)%10;
      (n-i)/=10;
    }
      
    if(s+t<min){
      min=s+t;
    }
  }
  
  cout<<min<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: lvalue required as left operand of assignment
   19 |       (n-i)/=10;
      |       ~~^~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int n;
  cin>>n;
  
  int s=0,t=0;
  int min=1000;
  
  for(i=0;i<n;i++){
    while(n>0){
      s+=i%10;
      i/=10;
    }
    
    while(t>0){
      t+=(n-i)%10;
      (n-i)/=10;
    }
      
    if(s+t<min){
      min=s+t;
    }
  }
  
  cout<<min<<endl;
}


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

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

int findthedigt(int n){
    int sum = 0;
    while(n > 0){
        sum += n % 10;
        n /= 10;
    }
    return sum;
}

int main(){
    int N;
    cin >> N;
    vector<int> a(N-1);

    for(int i = 1;i < N;++i){
        a[i-1] = findthedigt(i) + findthedigt(N - i);
    }

    int mn  = a[0];
    for(int i = 0;i < N -1;++i){
        if(mn > a[i])mn = a[i];
    }
    
    cout << mn << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:29:24: error: expected '}' at end of input
   29 |     cout << mn << endl;
      |                        ^
a.cc:15:11: note: to match this '{'
   15 | int main(){
      |           ^
Language: C++

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

int main() {
  int N,a,b;
  cin>>N;
  int m=N;
  int A[5]={},B[5]={};
  for(int i=1;i<N/2;i++){
    int sum=0;
    a=i;
    b=N-a;
    for (int j=0;j<5;j++){
      A[j]=a%10,a/=10;
      B[j]=b%10,b/=10;
      sum+=A[j]+B[j];
    }
    m=min(sum,m);
 	 }
	cout<<m<<endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>N;
      |   ^~~
a.cc:18:7: error: 'min' was not declared in this scope; did you mean 'main'?
   18 |     m=min(sum,m);
      |       ^~~
      |       main
a.cc:20:9: error: 'cout' was not declared in this scope
   20 |         cout<<m<<endl;
      |         ^~~~
a.cc:20:18: error: 'endl' was not declared in this scope
   20 |         cout<<m<<endl;
      |                  ^~~~
Language: C

#include <stdio.h>

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

    if (n%10 == 0){
        printf("10\n");
    } else {
        for (i = 0; i < 10; i++)
        {
            sum += n % 10;
            n /= 10;
            if (n < 10){
                sum+=n;
                break;
            }
        }
        printf ("%d\n", sum);       
    }
}#include <stdio.h>

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

    if (n%10 == 0){
        printf("10\n");
    } else {
        for (i = 0; i < 10; i++)
        {
            sum += n % 10;
            n /= 10;
            if (n < 10){
                sum+=n;
                break;
            }
        }
        printf ("%d\n", sum);       
    }
}

Compiler output:
main.c:21:2: error: stray '#' in program
   21 | }#include <stdio.h>
      |  ^
main.c:21:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   21 | }#include <stdio.h>
      |           ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int findSumOfDigits(int n) {
  int sum = 0;
  while(n > 0) {
    sum += n % 10;
      n /= 10;
  }
  return sum;
}


int main()
{
  int N;
  cin >> N;
  
  int sum_digit;
  int min = 1000000;
  
  
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      a = i;
      b = j;
 
      sum_digit = findSumOfDigits(i) + findSumOfDigits(j);
      if(sum_digit < min) {
        min = sum_digit;
      }
    }
  }
  cout << min << endl;
}

        

Compiler output:
a.cc: In function 'int main()':
a.cc:26:7: error: 'a' was not declared in this scope
   26 |       a = i;
      |       ^
a.cc:27:7: error: 'b' was not declared in this scope
   27 |       b = j;
      |       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int sed(int i){
  int sum = 0;
  while(i > 0){
    sum += i % 10;
    sum /= 10;
  }
  return sum;
}
int main(){
  int n;
  cin >> n;
  if(n == 10 || n == 100 || n == 1000 || n == 10000) {cout << 10 << endl; return 0;}
  else cout << sum << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: 'sum' was not declared in this scope
   15 |   else cout << sum << endl;
      |                ^~~
Language: C++

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

int ketasum(int n){
  int sum = 0;
  while (n > 0){
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

int main(){
  int n;
  cin >> n;
  for (int a = 1; a <= n; a++){
    int b = n - a;
    vector<int> sum;
    for (int i = 0; i < n; i++) sum[i] = ketasum(a) + ketasum(b);
  }

  sort(sum.begin(), sum.end());
  cout << sum[0] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:8: error: 'sum' was not declared in this scope
   22 |   sort(sum.begin(), sum.end());
      |        ^~~
Language: C++

n=gets.to_i
array=[]
def sum_of_digits(c)
   c.to_s.split("").map { |s| s.to_i }.inject(:+)
end
 n.times do |a|
 b=n-a
 array.push(sum_of_digits(b)+sum_of_digits(a))
 a+=1
 end
p array.min

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n=gets.to_i
      | ^
a.cc:4:39: error: expected unqualified-id before '.' token
    4 |    c.to_s.split("").map { |s| s.to_i }.inject(:+)
      |                                       ^
Language: C++

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

int sum(int n){
  int sum = 0;
  while(n > 0){
    sum += n%10;
    n /= 10;
  }
  return sum;
}
int main(){
  int N;
  cin >> N;
  int sum_A, sum_B;
  sum_B = 10000000
  for(int i = 1; i <= N - 1;i++){
    sum_A = sum(i) + sum(N - i);
    if(sum_B >= sum_A){
      sum_B = sum_A;
    }
  }
  cout << sum_B << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: expected ';' before 'for'
   16 |   sum_B = 10000000
      |                   ^
      |                   ;
   17 |   for(int i = 1; i <= N - 1;i++){
      |   ~~~              
a.cc:17:18: error: 'i' was not declared in this scope
   17 |   for(int i = 1; i <= N - 1;i++){
      |                  ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<queue>
#define REP(i,a) for (int i = 0;i < (a);++i)
#define FOR(i,a,b) for (int i = (a);i < (b); ++i)
#define FORR(i,a,b) for (int i = (a);i >= (b); --i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SORT(list) sort(ALL((list)));
#define MOD 1000000007
using namespace std;
using ll = long long;

int digitsum(int n){
    int answer = 0;
    while(n!=0){
        answer+=n%10;
        n/=10;
    }
    return answer;
}
int main(){
    int n;
    cin >> n;
    int answer = INT_MAX;

    FOR(i,1,n/2+1){
        answer=min(answer,digitsum(i)+digitsum(n-i));
    }
    cout << answer << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:28:18: error: 'INT_MAX' was not declared in this scope
   28 |     int answer = INT_MAX;
      |                  ^~~~~~~
a.cc:8:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    7 | #include<queue>
  +++ |+#include <climits>
    8 | #define REP(i,a) for (int i = 0;i < (a);++i)
Language: C++

#include<iostream>
#include<cmath>
#include<Algorithm>


using namespace std;

//入力xの各桁の和を求める
int digitsum(int x){
    int sum = 0;
    while(x>0){
        sum+=x%10;
        x/=10;
    }
    return sum;
}

int main(){

    int A,B,N;
    int sum;
    int ans = 100000;
    cin >> N;

    for(int i=1; i<N; i++){
        A = i;
        B = N - i;
        int DsumA = digitsum(A);
        int DsumB = digitsum(B); 
        sum = DsumA + DsumB;
        ans = min(ans,sum);
    }

    cout << ans << endl;


    return 0;
}

Compiler output:
a.cc:3:9: fatal error: Algorithm: No such file or directory
    3 | #include<Algorithm>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C++

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

int f(int x) {
    if (!x){
        return 0;
    }else if{
        return f(x / 10) + x % 10;
    }
}
 
int main() {
    int n; cin >> n;
    int ans = 1001001001;
    for(int i = 0; i <= n-1; i++) {
    ans = min(ans, f(i) + f(n - i));
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int f(int)':
a.cc:7:13: error: expected '(' before '{' token
    7 |     }else if{
      |             ^
      |             (
a.cc:10:1: warning: control reaches end of non-void function [-Wreturn-type]
   10 | }
      | ^
Language: C++

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

int f(int x) {
    if (!x){
      return 0;
    }
    return f(x / 10) + x % 10;
}
 
int main() {
    int n; cin >> n;
    int ans = INF;
    for(int i = 0; i <= n-1; i++) {
    ams = min(ans, f(i) + f(n - i));
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: 'INF' was not declared in this scope
   13 |     int ans = INF;
      |               ^~~
a.cc:15:5: error: 'ams' was not declared in this scope; did you mean 'ans'?
   15 |     ams = min(ans, f(i) + f(n - i));
      |     ^~~
      |     ans
Language: C++

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

int f(int a, int b){
  int i=0, j=0;
  while(a){
    i += a%10;
    a /= 10;
  }
  while(b){
    j += b%10;
    b /= 10;
  }
  return i+j;
}

int main(){
  int n;
  cin >> n;
  int ans = n;
  rep(a,n)rep(a,b){
    if(a+b == n) ans = min(ans, f(a, b));
  }
  cout << ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: 'b' was not declared in this scope
   23 |   rep(a,n)rep(a,b){
      |                 ^
a.cc:2:33: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0; i<n; i++)
      |                                 ^
Language: C++

#include <bits/stdc++.h>

#define fi first
#define se second
#define mp make_pair
#define pb push_back

using namespace std;
typedef long long ll;

const int maxn = 2005;

int digit(int val)
{
  int res = 0;
  while (val){
    res += val % 10;
    val /= 10;
  }
  return res;
}

signed main(void)
{
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  if (fopen("A.INP", "r")){
    freopen("A.INP", "r", stdin);
    freopen("A.OUT", "w", stdout);
  }
  int n; cin >> n;
  int res = 1e9;
  for (int a = 1; a < n; ++a){
    int b = n - a;
    res = min(res, digit(a) + digit(b));
  }
  cout << res << '\n';
}
#include <bits/stdc++.h>

#define fi first
#define se second
#define mp make_pair
#define pb push_back

using namespace std;
typedef long long ll;

const int maxn = 2005;

int digit(int val)
{
  int res = 0;
  while (val){
    res += val % 10;
    val /= 10;
  }
  return res;
}

signed main(void)
{
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  if (fopen("A.INP", "r")){
    freopen("A.INP", "r", stdin);
    freopen("A.OUT", "w", stdout);
  }
  int n; cin >> n;
  int res = 1e9;
  for (int a = 1; a < n; ++a){
    int b = n - a;
    res = min(res, digit(a) + digit(b));
  }
  cout << res << '\n';
}


Compiler output:
a.cc:48:11: error: redefinition of 'const int maxn'
   48 | const int maxn = 2005;
      |           ^~~~
a.cc:11:11: note: 'const int maxn' previously defined here
   11 | const int maxn = 2005;
      |           ^~~~
a.cc:50:5: error: redefinition of 'int digit(int)'
   50 | int digit(int val)
      |     ^~~~~
a.cc:13:5: note: 'int digit(int)' previously defined here
   13 | int digit(int val)
      |     ^~~~~
a.cc:60:8: error: redefinition of 'int main()'
   60 | signed main(void)
      |        ^~~~
a.cc:23:8: note: 'int main()' previously defined here
   23 | signed main(void)
      |        ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define outc cout
#define int long long
signed main(){
  int a,g[1000000]={};
  int b=0,c=1,d,e=0,f=1000000,l=0;
  cin>>a;
  for(int i=1;i<=(a+1)/;i++){
    b=a-i;
    c=i;
    e=0;
    while(true){
      if(b==0) break;
      e+=b%10;
      b/=10;
    }
    while(true){
      if(c==0) break;
      e+=c%10;
      c/=10;
    }
    f=min(e,f);
  }
  outc<<f<<"\n";
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: expected primary-expression before ';' token
    9 |   for(int i=1;i<=(a+1)/;i++){
      |                        ^
Language: C

#include <stdio.h>

int main(void) {
	unsigned long long int n, m, p, q = 20000000;
	
	scanf("%lld", &n);
	
	for(i=1;i<n;i++) {
		for(o=i;;o++) {
			m = i * o;
			p = i + o;
			if(m == n&&q > p) {
				q = p
			}
		}

Compiler output:
main.c: In function 'main':
main.c:8:13: error: 'i' undeclared (first use in this function)
    8 |         for(i=1;i<n;i++) {
      |             ^
main.c:8:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:21: error: 'o' undeclared (first use in this function)
    9 |                 for(o=i;;o++) {
      |                     ^
main.c:13:38: error: expected ';' before '}' token
   13 |                                 q = p
      |                                      ^
      |                                      ;
   14 |                         }
      |                         ~             
main.c:15:17: error: expected declaration or statement at end of input
   15 |                 }
      |                 ^
main.c:15:17: error: expected declaration or statement at end of input
Language: C++

#include <iostream>
using namespace std;
  
int main() {
  long long n;
  long long ans=__LONG_LONG_MAX__;
  cin >> n;
 
  
  for(int x=1;x<=(n/2)+1;x++){
    int A=x;
    int B=n-x;
    int sumA=0;
    int sumB=0;
    while(A>0){
      int temp=A%10;
      sumA+=temp;
      A=A/10;
    }
    while(B>0){
      int temp=B%10;
      sumB+=temp;
      B=B/10;
    }
    ans=min(ans,(sumA+sumB));
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:12: error: no matching function for call to 'min(long long int&, int)'
   25 |     ans=min(ans,(sumA+sumB));
      |         ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:25:12: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   25 |     ans=min(ans,(sumA+sumB));
      |         ~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include <iostream>
using namespace std;
  
int main() {
  int n;
  int ans=0;
  cin >> n;
  int count=n/2+1;
  
  for(int x=1,x<=n.x++){
    if(x=count){
      break;
    }
    int A=x;
    int B=n-x;
    int sumA=0;
    int sumB=0;
    while(A>0){
      int temp=A%10;
      sumA+=temp;
      A=A/10;
    }
    while(B>0){
      int temp=B%10;
      sumB+=temp;
      B=B/10;
    }
    ans=min(ans,(sumA+sumB));
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: expected ';' before '<=' token
   10 |   for(int x=1,x<=n.x++){
      |                ^~
      |                ;
a.cc:10:16: error: expected primary-expression before '<=' token
   10 |   for(int x=1,x<=n.x++){
      |                ^~
a.cc:10:20: error: request for member 'x' in 'n', which is of non-class type 'int'
   10 |   for(int x=1,x<=n.x++){
      |                    ^
a.cc:10:23: error: expected ';' before ')' token
   10 |   for(int x=1,x<=n.x++){
      |                       ^
      |                       ;
Language: C++

#include <iostream>
using namespace std
  
int main() {
  int n;
  int ans=0;
  cin >> n;
  count=n/2+1;
  
  for(int x=1,x<=n.x++){
    if(x=count){
      break;
    }
    int A=x;
    int B=n-x;
    int sumA=0;
    int sumB=0;
    while(A>0){
      int temp=A%10;
      sumA+=temp;
      A=A/10;
    }
    while(B>0){
      int temp=B%10;
      sumB+=temp;
      B=B/10;
    }
    ans=min(ans,(sumA+sumB));
  }
  cout << ans;
}

Compiler output:
a.cc:2:20: error: expected ';' before 'int'
    2 | using namespace std
      |                    ^
      |                    ;
    3 | 
    4 | int main() {
      | ~~~                 
a.cc: In function 'int main()':
a.cc:8:3: error: 'count' was not declared in this scope
    8 |   count=n/2+1;
      |   ^~~~~
a.cc:10:16: error: expected ';' before '<=' token
   10 |   for(int x=1,x<=n.x++){
      |                ^~
      |                ;
a.cc:10:16: error: expected primary-expression before '<=' token
   10 |   for(int x=1,x<=n.x++){
      |                ^~
a.cc:10:20: error: request for member 'x' in 'n', which is of non-class type 'int'
   10 |   for(int x=1,x<=n.x++){
      |                    ^
a.cc:10:23: error: expected ';' before ')' token
   10 |   for(int x=1,x<=n.x++){
      |                       ^
      |                       ;
Language: C++

include <iostream>
using namespace std
  
int main() {
  int n;
  int ans=0;
  cin >> n;
  count=n/2+1;
  
  for(int x=1,x<=n.x++){
    if(x=count){
      break;
    }
    int A=x;
    int B=n-x;
    int sumA=0;
    int sumB=0;
    while(A>0){
      int temp=A%10;
      sumA+=temp;
      A=A/10;
    }
    while(B>0){
      int temp=B%10;
      sumB+=temp;
      B=B/10;
    }
    ans=min(ans,(sumA+sumB));
  }
  cout << ans;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<cmath>

int sum(int n) {
  int sum = 0;
  std::string str = std::to_string(n);
  for (int i=0; i<str.size(); i++) {
    sum += int(str.at(i))-"0";
  }
  return sum;
}

int main() {
  int N;
  int temp_min;
  std::cin >> N;
  for (int i=1; i<N; i++) {
    if (i==1) {
      temp_min = sum(i)+sum(N-i);
    }
    else {
      temp_min = std::min(temp_min, sum(i)+sum(N-i));
    }
  }
  std::cout << temp_min << std::endl;
}


Compiler output:
a.cc: In function 'int sum(int)':
a.cc:9:26: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator-'
    9 |     sum += int(str.at(i))-"0";
      |            ~~~~~~~~~~~~~~^~~~
      |            |              |
      |            int            const char [2]
Language: C++

#include<iostream>
#include<string>
#include<cmath>

int sum(int n) {
  int sum = 0;
  std::string str = std::to_string(n);
  for (int i=0; i<str.size(); i++) {
    sum += int(str.at(i))-int("0");
  }
  return sum;
}

int main() {
  int N;
  int temp_min;
  std::cin >> N;
  for (int i=1; i<N; i++) {
    if (i==1) {
      temp_min = sum(i)+sum(N-i);
    }
    else {
      temp_min = std::min(temp_min, sum(i)+sum(N-i));
    }
  }
  std::cout << temp_min << std::endl;
}


Compiler output:
a.cc: In function 'int sum(int)':
a.cc:9:27: error: cast from 'const char*' to 'int' loses precision [-fpermissive]
    9 |     sum += int(str.at(i))-int("0");
      |                           ^~~~~~~~
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int ans = 1000;
    for (int a = 1; a < N; a++) {
      int A = a;
      int B = N-a;
      int tmp = 0;
      while (A > 0) {
        tmp += A%10;
        A /= 10;
      }
      while (B > 0) {
        tmp = += B%10;
        B /= 10;
      }
      ans = Math.min(ans, tmp);
    }
    System.out.println(ans);
  }
}



Compiler output:
Main.java:17: error: illegal start of expression
        tmp = += B%10;
              ^
1 error
Language: C++

#include <iostream>
using namespace std;
int digitSum(int num) {
    int ret = 0;
    while (num > 0) {
        ret += num % 10;
        num /= 10;
    }
    return ret;
}
int main() {
    int N;
    cin >> N;
    int ans = N
    for (int A = 1; A < N; A++) {
        int B = N - A;
        int t = digitSum(A) + digitSum(B);
        if (t < ans) ans = t;
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: expected ',' or ';' before 'for'
   15 |     for (int A = 1; A < N; A++) {
      |     ^~~
a.cc:15:21: error: 'A' was not declared in this scope
   15 |     for (int A = 1; A < N; A++) {
      |                     ^
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main() {
  long long int a,b,c,d,e,f,g[110],h[110];
  cin >>a;
  d =10000
  for(int i=0;i<a;i++){
    
   b =(i%10+i%100/10+i%1000/100+i%10000/1000+i%100000/10000);
    c =((a-i)%10+(a-i)%100/10+(a-i)%1000/100+(a-i)%10000/1000+(a-i)%100000/10000);
    
    d =min(d,(b+c));
  }
  
  cout << d << endl;
}
    
   

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  
long long N;

  long long calc(int N) {
    int res = 0;
    while(N > 0) {
        res += N % 10;
        N /= 10;
    }
    return res;
  }
 
    

    while (cin >> N) {
        long long res = 1LL<<60;
        for (long long i = 1; i < N; ++i) {
            long long j = N - i;
            long long tmp = calc(i) + calc(j);
            res = min(res, tmp);
        }
        cout << res << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: a function-definition is not allowed here before '{' token
    7 |   long long calc(int N) {
      |                         ^
a.cc:22:29: error: 'calc' was not declared in this scope
   22 |             long long tmp = calc(i) + calc(j);
      |                             ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  
long long N;

  long long calc(int N) {
    int res = 0;
    while(N > 0) {
        res += N % 10;
        N /= 10;
    }
    return res;
  }
 
int main() {
  while (cin >> N) {
    long long res = 1LL<<60;
    for (
    
int main() {
    while (cin >> N) {
        long long res = 1LL<<60;
        for (long long i = 1; i < N; ++i) {
            long long j = N - i;
            long long tmp = calc(i) + calc(j);
            res = min(res, tmp);
        }
        cout << res << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: a function-definition is not allowed here before '{' token
    7 |   long long calc(int N) {
      |                         ^
a.cc:16:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   16 | int main() {
      |         ^~
a.cc:16:9: note: remove parentheses to default-initialize a variable
   16 | int main() {
      |         ^~
      |         --
a.cc:16:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:16:12: error: a function-definition is not allowed here before '{' token
   16 | int main() {
      |            ^
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

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

int main(){
    int N; cin >> N;
    int check = 1;
    bool jud = false;
    int sum = 0;

    rep(i,5){
        check *= 10;
        if(check == N){
            jud = true;
        }
    }

    if(jud){
        cout << 10 << endl;
    }

    else{
        while(N!=0){
            sum += N%10;
            N /= 10;
        }

        cout << sum << endl;
    }

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

#include<iostream>
using namespace std;
int SumDigit(int num){
  int sum=0;
  while(num>0){sum+=num%10;num/=10}
  return sum;
}
int main(){
  int N;cin>>N;
  int a, b, tmp;
  int min=1e5;
  for(a=1;a<N-1;a++){b=N-a;tmp = SumDigit(a)+SumDigit(b);if(min>tmp)min=tmp;}
  cout<<min<<endl;
}

Compiler output:
a.cc: In function 'int SumDigit(int)':
a.cc:5:35: error: expected ';' before '}' token
    5 |   while(num>0){sum+=num%10;num/=10}
      |                                   ^
      |                                   ;