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

#include<iostream>
#include<string>
using namespace std;
int reverse(int n)
{
    int i=0;
    while(n!=0){
        i+=n%10;
        n/10;
    }
    return 0;
}
int main()
{
    int N,A,B,min,cnt;
    for(A=1,B=N-A,min=114514;A<=N-1;A++){
        if(reverse(A)+reverse(B)<min)
        min=reverse(A)+reverse(B)
    }
    cout<<min<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:34: error: expected ';' before '}' token
   18 |         min=reverse(A)+reverse(B)
      |                                  ^
      |                                  ;
   19 |     }
      |     ~
Language: C++

#inlude <iostream>
using namespace std;

#define MIN(X,Y) ((X)<(Y)?(X):(Y))

int digSum(int n){
  int ans=0;
  while (n){
    ans += n%10;
    n /= 10;
  }
  return n;
}

int main(void){
  int n,ans;
  cin >> n;
  ans = 2<<30;
  for (int i=0; i<=n/2; i++){
    int t;
    t = digSum(i) + digSum(n-i);
    ans = MIN(ans,t);
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlude; did you mean #include?
    1 | #inlude <iostream>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:17:3: error: 'cin' was not declared in this scope
   17 |   cin >> n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inlude <iostream>
a.cc:24:3: error: 'cout' was not declared in this scope
   24 |   cout << ans << endl;
      |   ^~~~
a.cc:24:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:18: error: 'endl' was not declared in this scope
   24 |   cout << ans << endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inlude <iostream>
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

#define INF 1<<30
#define LINF 1ll<<60ll
#define MOD 1000000007
#define pb(a) push_back(a)

#define _overload3(_1,_2,_3,_4,name,...) name
#define _rep(i,n) _repi(i,0,n)
#define _repi(i,a,b) for(int i=a, i##_len=(b); i<i##_len; ++i)
#define _repis(i,a,b,s) for(int i=a, i##_len(b); i<i##_len; i+=s)
#define REP(...) _overload3(__VA_ARGS__,_repis,_repi,_rep,)(__VA_ARGS__)

#define REPR(i, n) for(int i = n;i >= 0;--i)
#define REPARR(i, v) for(int i = 0;i < sz(v);++i)

#define all(vec) (vec.begin()),(vec.end())
#define sz(x) ((int)(x).size())
#define bit(n) (1ll<<(n))

template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}

#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define yes(n) cout<<((n)?"yes":"no")<<endl
#define poss(n) cout<<((n)?"possible":"impossible")<<endl
#define Poss(n) cout<<((n)?"Possible":"Impossible")<<endl
#define POSS(n) cout<<((n)?"POSSIBLE":"IMPOSSIBLE")<<endl



int main(){
    string n;
    cin>>n;
    int wa=0;
    bool f=true;
    REPARR(i,n){
        if(i==0){
            if(n[i]!='1')flag=false;
        }else{
            if(n[i]!='0')flag=false;
        }
        wa+=n[i]-'0';
    }
    if(flag)cout<<10<<endl;
    else cout<<wa<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:26: error: 'flag' was not declared in this scope
   50 |             if(n[i]!='1')flag=false;
      |                          ^~~~
a.cc:52:26: error: 'flag' was not declared in this scope
   52 |             if(n[i]!='0')flag=false;
      |                          ^~~~
a.cc:56:8: error: 'flag' was not declared in this scope
   56 |     if(flag)cout<<10<<endl;
      |        ^~~~
Language: C++

n = int(input())
def sum(X):
	c = 0
	while(X>0):
		c += X%10
		X//=10
	return c
ans = (1<<30)
for i in range(1, n):
	ans = min(ans, sum(i) + sum(n-i))
print(ans)

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

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

const ll mod = 10651, N = 20;
ll mn = 1e9, n;

int f(int k) {
	int res = 0;
	while (k) {
		res += k % 10;
		k /= 10;
	}
	return res;
}

int main() {
	cin >> n;
	for (int i = 1; i < n; i++)
		mn = min(mn, f(i) + f(n - i));
	cout << mn;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: no matching function for call to 'min(ll&, int)'
   20 |                 mn = min(mn, f(i) + f(n - i));
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~
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: '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:20:25: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   20 |                 mn = min(mn, f(i) + f(n - i));
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~
/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:20:25: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   20 |                 mn = min(mn, f(i) + f(n - i));
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~
Language: C

#include<stdio.h>
int degree(int x){
  int i,count;
  count=0;
  for(i=1;i<100000;i=i*10){
    if(x%i==x) break;
    count++;
  }
  return count;
}

int tasizann(int x,int y){
  int i,ten,count;
  count = 0;
  ten=1;
  for(i=y;i>1;i--){
    ten=ten*10;
  }
  for(i=ten;i>0;i=i/10){
    count=count + (x/i);
    x=x%i;
  }
  return count;
  
}

int main(){
  int  A,B,N,a,b,sum1,sum2,i,k;
  scanf("%d",&N);
  b=100000;
  A=N-1;
  B=1;
  while(A>=B){
    sum1=tasizann(A,degree(A));
    sum2=tasizann(B,degree(B));
    a=sum1+sum2;
    if(b>a) b=a;
    A--;
    B++
    }
  printf("%d",b);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:39:8: error: expected ';' before '}' token
   39 |     B++
      |        ^
      |        ;
   40 |     }
      |     ~
Language: C++

#include <iostream>

using namespace std;

int sum (int n) {
  int s = 0;
  while (n) {
    s += n % 10;
    n /= 10;
  }
  return s;
}
int minn = INT_MAX, n;

int main()
{
  cin >> n;
  for (int i = 1; i <= n / 2; i++) {
    if (sum(i) + sum(n - i) < minn)
      minn = sum(i) + sum(n - i);
  }
  cout << minn;
  return 0;
}


Compiler output:
a.cc:13:12: error: 'INT_MAX' was not declared in this scope
   13 | int minn = INT_MAX, n;
      |            ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 | 
a.cc: In function 'int main()':
a.cc:17:10: error: 'n' was not declared in this scope
   17 |   cin >> n;
      |          ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	ios::sync_with_stdio(0);
	int N;
	cin>>N;
	int min=INT_MAX;
	for(int i=1;i<N;++i){
		string S,T;
		S=to_string(i);
		T=to_string(N-i);
		int sum=0;
		for(int k=0;k<S.size();++k){
			sum+=S.at(k)-'0';
		}
		for(int k=0;k<T.size();++k){
			sum+=T.at(k)-'0';
		}
		if(sum<min)min=sum;
	}
	cout<<min<<"\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'INT_MAX' was not declared in this scope
    8 |         int min=INT_MAX;
      |                 ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include<iostream>
  +++ |+#include <climits>
    2 | using namespace std;
Language: C++

#include<bits/stdc++.h>
#define FIO "Digits Sum"
using namespace std;

int n , ans = 0;

inline int calc(int x)
{
	int res = 0;
	while(x)
	{
		res += x % 10;
		x /= 10;
	}
	return res;
}

int main()
{
	n = read();
	for(int i = 1; i < n; i ++)
	{
		ans = max(ans , calc(i) + calc(n - i));
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: too few arguments to function 'ssize_t read(int, void*, size_t)'
   20 |         n = read();
      |             ~~~~^~
In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /usr/include/c++/14/csignal:42,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:116,
                 from a.cc:1:
/usr/include/unistd.h:371:16: note: declared here
  371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
Language: C++

  1 #include <bits/stdc++.h> 
  2 using namespace std; 
  3  
  4 int digsum(int x){ 
  5     int dsum = 0; 
  6     while(x){ 
  7         dsum += x%10; 
  8         x /= 10; 
  9     } 
 10     return dsum; 
 11 } 
 12  
 13 int main(){ 
 14     int n, mds = 1e5; 
 15     cin >> n; 
 16     for(int i = 1; i < n; i++) 
 17         mds = min(mds, digsum(i) + digsum(n-i)); 
 18     cout << mds << endl; 
 19     return 0; 
 20 }  

Compiler output:
a.cc:1:5: error: stray '#' in program
    1 |   1 #include <bits/stdc++.h>
      |     ^
a.cc:1:3: error: expected unqualified-id before numeric constant
    1 |   1 #include <bits/stdc++.h>
      |   ^
a.cc:3:3: error: expected unqualified-id before numeric constant
    3 |   3
      |   ^
a.cc:12:2: error: expected unqualified-id before numeric constant
   12 |  12
      |  ^~
Language: C++

  1 #include <bit/stdc++.h> 
  2 using namespace std; 
  3  
  4 int digsum(int x){ 
  5     int dsum = 0; 
  6     while(x){ 
  7         dsum += x%10; 
  8         x /= 10; 
  9     } 
 10     return dsum; 
 11 } 
 12  
 13 int main(){ 
 14     int n, mds = 1e5; 
 15     cin >> n; 
 16     for(int i = 1; i < n; i++) 
 17         mds = min(mds, digsum(i) + digsum(n-i)); 
 18     cout << mds << endl; 
 19     return 0; 
 20 }  

Compiler output:
a.cc:1:5: error: stray '#' in program
    1 |   1 #include <bit/stdc++.h>
      |     ^
a.cc:1:3: error: expected unqualified-id before numeric constant
    1 |   1 #include <bit/stdc++.h>
      |   ^
a.cc:3:3: error: expected unqualified-id before numeric constant
    3 |   3
      |   ^
a.cc:12:2: error: expected unqualified-id before numeric constant
   12 |  12
      |  ^~
Language: C++

#include <bits/stdc++.h>
#define pb push_back
#define ll long long

using namespace std;



int main()
{
    int n;
    cin >> n;
    int ans=n;
    char A[10],B[10];
    for(int a=1;a<n;a++){
        int curr=0;
        itoa(a,A,10);
        itoa(n-a,B,10);
        for(int i=0;A[i];i++)
            curr+=A[i]-'0';
        for(int i=0;B[i];i++)
            curr+=B[i]-'0';
        ans=min(ans,curr);
    }
    cout << ans;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'itoa' was not declared in this scope
   17 |         itoa(a,A,10);
      |         ^~~~
Language: C++

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

int dsum(int a){
  int ret=0;
  for(int i=0; i<6; i++){
    ret += a%10;
    a /= 10;
  }
  cout << ret;
}

int main(){
  int n;
  cin >> n;
  int ret = 1000
  for(int a=1; a<=n/2; a++){
    ret = min(ret, dsum(a)+dsum(n-a));
  }
  cout << ret;
  return 0;
}

Compiler output:
a.cc: In function 'int dsum(int)':
a.cc:12:1: warning: no return statement in function returning non-void [-Wreturn-type]
   12 | }
      | ^
a.cc: In function 'int main()':
a.cc:18:3: error: expected ',' or ';' before 'for'
   18 |   for(int a=1; a<=n/2; a++){
      |   ^~~
a.cc:18:16: error: 'a' was not declared in this scope
   18 |   for(int a=1; a<=n/2; a++){
      |                ^
Language: C++

//Artie WANG
//io
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <sstream>

//data structure
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
//#include <unordered_map>
//#include <unordered_set>
#include <utility>
#include <bitset>
#include <complex>

//algorithm
#include <algorithm>
#include <cmath>
#include <cstdlib>

//debug
#include <cassert>
#include <ctime>
#include <climits>

using namespace std;

typedef pair<int, int> ii;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> l4;

#define mp make_pair
#define pb push_back
#define debug(x) cerr << #x << " = " << x << endl

const int maxn = 1e5+1;
int cnt[maxn], n;

int main()
{
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i)
    cnt[i] = cnt[i/10] + i%10;
  function<int(int)> solve;
  solve = [&](int x)
    {
      return cnt[x] + cnt[n-x];
    };
  int ans = solve(1);
  for (int i = 1; i <= n-1; ++i)
    ans = min(ans, solve(i));
  printf("%d\n", ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:3: error: 'function' was not declared in this scope
   53 |   function<int(int)> solve;
      |   ^~~~~~~~
a.cc:33:1: note: 'std::function' is defined in header '<functional>'; this is probably fixable by adding '#include <functional>'
   32 | #include <climits>
  +++ |+#include <functional>
   33 | 
a.cc:53:12: error: expected primary-expression before 'int'
   53 |   function<int(int)> solve;
      |            ^~~
a.cc:54:3: error: 'solve' was not declared in this scope
   54 |   solve = [&](int x)
      |   ^~~~~
Language: C++

include <bits/stdc++.h>

using namespace std;


int sumdigits(int n)
{

	int sum=0,r;
	while(n!=0)
	{
        r=n%10;
        sum+=r;
        n=n/10;
	}
	return sum;
}
int main()

{
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif

    int n,ans=100010,i;
    cin>>n;
    for(i=1;i<n;i++)
    {
    	ans=min(ans,sumdigits(i)+sumdigits(n-i));
    }
    cout<<ans;



    return 0;
}

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:22:29: error: 'stdin' was not declared in this scope
   22 |     freopen("input.txt","r",stdin);
      |                             ^~~~~
a.cc:1:1: note: 'stdin' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | include <bits/stdc++.h>
a.cc:22:5: error: 'freopen' was not declared in this scope
   22 |     freopen("input.txt","r",stdin);
      |     ^~~~~~~
a.cc:23:30: error: 'stdout' was not declared in this scope
   23 |     freopen("output.txt","w",stdout);
      |                              ^~~~~~
a.cc:23:30: note: 'stdout' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:27:5: error: 'cin' was not declared in this scope
   27 |     cin>>n;
      |     ^~~
a.cc:30:13: error: 'min' was not declared in this scope; did you mean 'main'?
   30 |         ans=min(ans,sumdigits(i)+sumdigits(n-i));
      |             ^~~
      |             main
a.cc:32:5: error: 'cout' was not declared in this scope
   32 |     cout<<ans;
      |     ^~~~
Language: C++

#include <iostream>

using namespace std;



int main(void){
    long N;
    long A;
    long B;
    long C;
    long anskouho=0;
    long ans=100000;
    cin>>N;
    
    
    
    for(A=1;A<=N-1;A++)
    {
        B=N-A;
        C=A;
        anskouho=0;
        while (C > 0)
        {
            anskouho+=C%10;
            C=C/10;
        }
        while (B >0)
        {
            anskouho+=B%10;
            B=B/10;
        }
        if(anskouho<ans)
        {
            ans=anskouho;
            
        }
        else
        {
            
        }
        
        
    }
   
    
    
    
    cout<<ans<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:49:21: error: expected '}' at end of input
   49 |     cout<<ans<<endl;
      |                     ^
a.cc:7:15: note: to match this '{'
    7 | int main(void){
      |               ^
Language: C++

#include<iostream>
using namespace std;

long sumdig(long A)
{
    long sum=0,rem;

    while(A>0)
    {
        rem=A%10;
        A=A/10;
        sum+=rem;
    }

    return sum;
}

int main()
{
    long N,A,B,ans=INT_MAX;
    cin>>N;
    A=1;
    B=N-A;

    while(B>= N/2)
    {
      ans= min(ans,sumdig(A) + sumdig(B));

      A=A+1;
      B=B-1;
    }

    cout<<ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:20: error: 'INT_MAX' was not declared in this scope
   20 |     long N,A,B,ans=INT_MAX;
      |                    ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include<iostream>
  +++ |+#include <climits>
    2 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  if(n%10==0) cout<<"10"<<endl;
  else{
    while(n){
      dig=n%10;
      sum+=dig;
      n=n/10;
    }
    cout<<sum<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'dig' was not declared in this scope; did you mean 'div'?
    9 |       dig=n%10;
      |       ^~~
      |       div
a.cc:10:7: error: 'sum' was not declared in this scope
   10 |       sum+=dig;
      |       ^~~
a.cc:13:11: error: 'sum' was not declared in this scope
   13 |     cout<<sum<<endl;
      |           ^~~
Language: C

#include "stdlib.h"

int digit(int A,int B);

int main(void)
{
  int N;
  scanf("%d",&N);
  int A,B,tmp;
  int min = 114514810;

  for(int i = 1;i <= N;i++)
    {
      A = i;
      B = N - i;
      tmp = digit(A,B);
      if(min > tmp)
	min = tmp;
    }
  printf("%d\n",min);
}

int digit(int A,int B)
{
 if(A == 10)

  int Adigitsum,Bdigitsum;
  Adigitsum = 0;
  Bdigitsum = 0;
  Adigitsum += A / 10000 != 0 ? A / 10000 : 0;
  Bdigitsum += B / 10000 != 0 ? B / 10000 : 0;
  A = A % 10000;
  B = B % 10000;
  Adigitsum += A / 1000 != 0 ? A / 1000 : 0;
  Bdigitsum += B / 1000 != 0 ? B / 1000 : 0;
  A = A % 1000;
  B = B % 1000;
  Adigitsum += A / 100 != 0 ? A / 100 : 0;
  Bdigitsum += B / 100 != 0 ? B / 100 : 0;
  A = A % 100;
  B = B % 100;
  Adigitsum += A / 10 != 0 ? A / 10 : 0;
  Bdigitsum += B / 10 != 0 ? B / 10 : 0;
  A = A % 10;
  B = B % 10;
  Adigitsum += A / 1 != 0 ? A / 1 : 0;
  Bdigitsum += B / 1 != 0 ? B / 1 : 0;
  return Adigitsum + Bdigitsum;
}



Compiler output:
main.c: In function 'main':
main.c:8:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    8 |   scanf("%d",&N);
      |   ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include "stdlib.h"
  +++ |+#include <stdio.h>
    2 | 
main.c:8:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    8 |   scanf("%d",&N);
      |   ^~~~~
main.c:8:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:20:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   20 |   printf("%d\n",min);
      |   ^~~~~~
main.c:20:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:20:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:20:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'digit':
main.c:27:3: error: expected expression before 'int'
   27 |   int Adigitsum,Bdigitsum;
      |   ^~~
main.c:28:3: error: 'Adigitsum' undeclared (first use in this function)
   28 |   Adigitsum = 0;
      |   ^~~~~~~~~
main.c:28:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:29:3: error: 'Bdigitsum' undeclared (first use in this function)
   29 |   Bdigitsum = 0;
      |   ^~~~~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <string>
#include <cmath>
#include <algorithm>

using namespace std;

#define pb push_back
#define mp make_pair
#define X first
#define Y second

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pii;
typedef vector<pii> vii;

const int MOD = 998244353;
const int INF = 2e9;
const int MAX_N = 300000;

ll factorial[MAX_N+1];
ll inverse[MAX_N+1];
 
// 繰り返し２乗法による冪乗(x^n)計算 O(log(n))
int exponentiation(ll x, int n) {
  int res = 1;
  while (0 < n) {
    if (n & 1) {
      res = x * res % MOD;
    }
    x = x * x % MOD;
    n >>= 1;
  }
  return res;
}
 
// 組み合わせ nCr の計算 O(1)
ll combination(int n, int r) {
  if (n-r==0 || r==0) return 1;
  static bool flag = true;
  if (flag) {
    // 階乗と階乗の逆数の初期化 O(n)
    factorial[0] = 1; inverse[0] = 1;
    for (int i=1; i<=MAX_N; i++) {
      factorial[i] = factorial[i-1] * i % MOD;
      inverse[i] = exponentiation(factorial[i], MOD-2);
    }
    flag = false;
  }
  return factorial[n] * inverse[n-r] % MOD * inverse[r] % MOD;
}

int main() {
  ll N, A, B, K, ans = 0;
  vii XYs;
  cin >> N >> A >> B >> K;
  for (int x = 0; x <= N; x++) {
    if ((K - A*x) % B != 0 || A*x>k) { continue; }

    ll y = (K - A*x) / B;
    if (y <= N) {
      // cout << x << ", " << y << endl;
      ans += (combination(N, x) % MOD) * (combination(N, y) % MOD);
      ans %= MOD;
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:35: error: 'k' was not declared in this scope
   63 |     if ((K - A*x) % B != 0 || A*x>k) { continue; }
      |                                   ^
Language: C++

#include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
int main(){
	char a[15];
	gets(a);
	int n=0;
	
	for(int i=0;i<strlen(a);i++){
		n+=a[i]-'0';
		}
	printf("%d\n",n);
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |         gets(a);
      |         ^~~~
      |         getw
Language: C++

#include<stdio.h>
main(){
int n;
while(scanf("%d",&n)!=EOF){
	if(n%10==0)
	printf("%d",10);
	else
	{
	int i,n2[6],sum=0;
	char n1[6];
	itoa(n,n1,10);
	for(i=0;i<6;i++)
	{
	if(n1[i]==NULL)
	break;
	n2[i]=n1[i]-'0';
	sum+=n2[i];
}printf("%d\n",sum);
}
}
}
 

Compiler output:
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:11:9: error: 'itoa' was not declared in this scope
   11 |         itoa(n,n1,10);
      |         ^~~~
a.cc:14:19: warning: NULL used in arithmetic [-Wpointer-arith]
   14 |         if(n1[i]==NULL)
      |                   ^~~~
Language: C

#include<stdio.h>
main(){
int n;
while(scanf("%d",&n)!=EOF){
	if(n%10==0)
	printf("%d",10);
	else
	{
	int i,n2[6],sum=0;
	char n1[6];
	itoa(n,n1,10);
	for(i=0;i<6;i++)
	{
	if(n1[i]==NULL)
	break;
	n2[i]=n1[i]-'0';
	sum+=n2[i];
}printf("%d\n",sum);
}
}
}
 

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:11:9: error: implicit declaration of function 'itoa' [-Wimplicit-function-declaration]
   11 |         itoa(n,n1,10);
      |         ^~~~
main.c:14:17: warning: comparison between pointer and integer
   14 |         if(n1[i]==NULL)
      |                 ^~
Language: C

#include<stdio.h>
#include<stdlib.h>
main(){
int n;
while(scanf("%d",&n)!=EOF){
	if(n%10==0)
	printf("%d",10);
	else
	{
	int i,n2[6],sum=0;
	char n1[6];
	itoa(n,n1,10);
	for(i=0;i<6;i++)
	{
	if(n1[i]==NULL)
	break;
	n2[i]=n1[i]-'0';
	sum+=n2[i];
}printf("%d\n",sum);
}}}
 

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:12:9: error: implicit declaration of function 'itoa' [-Wimplicit-function-declaration]
   12 |         itoa(n,n1,10);
      |         ^~~~
main.c:15:17: warning: comparison between pointer and integer
   15 |         if(n1[i]==NULL)
      |                 ^~
Language: C

#include<stdio.h>
#include<stdlib.h>
main(){
int n;
while(scanf("%d",&n)!=EOF){
	if(n%10==0)
	printf("%d",10);
	else
	{
	int i,n2[6],sum=0;
	char n1[6];
	itoa(n,n1,10);
	for(i=0;i<6;i++)
	{
		if(n1[i]==NULL)
	break;
	n2[i]=n1[i]-'0';
	sum+=n2[i];
}


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

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:12:9: error: implicit declaration of function 'itoa' [-Wimplicit-function-declaration]
   12 |         itoa(n,n1,10);
      |         ^~~~
main.c:15:25: warning: comparison between pointer and integer
   15 |                 if(n1[i]==NULL)
      |                         ^~
Language: C

#include <stdio.h>

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

int main(void) {
    int n, i, j, min=45;
    scanf("%d", &n);
    
    for(i=n-1; i>0; i--) {
        j = n-i;
        if(digit_sum(i)+digit_sum(j)<min)
            min = digit_sum(i)+digit_sum(j);
    }
    printf("%d\n", min);
}
#include <stdio.h>
#include <stdlib.h>
#define MAX 200000

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

int main(void) {
    int n, i, j, min=45;
    scanf("%d", &n);
    
    for(i=n-1; i>0; i--) {
        j = n-i;
        if(digit_sum(i)+digit_sum(j)<min)
            min = digit_sum(i)+digit_sum(j);
    }
    printf("%d\n", min);
}


Compiler output:
main.c:27:5: error: redefinition of 'digit_sum'
   27 | int digit_sum(int x) {
      |     ^~~~~~~~~
main.c:3:5: note: previous definition of 'digit_sum' with type 'int(int)'
    3 | int digit_sum(int x) {
      |     ^~~~~~~~~
main.c:36:5: error: redefinition of 'main'
   36 | int main(void) {
      |     ^~~~
main.c:12:5: note: previous definition of 'main' with type 'int(void)'
   12 | int main(void) {
      |     ^~~~
Language: C

include <stdio.h>

int main()
{
        int n, i = 1, j, a, b, mod, div, sum;
        int min = 999999;
        double st, en;

        scanf("%d", &n);

        while(i <= n / 2) {
                a = i;
                b = n - i;
                mod = 100000;
                sum = 0;
                for (j = 0; j < 6; j++) {
                         sum += a / mod;
                         a %= mod;
                         sum += b / mod;
                         b %= mod;
                         mod /= 10;
                }
                if (min > sum)
                        min = sum;
                i++;
        }
        printf("%d\n", min);
        return 0;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C++

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

int sumofDigits(int N)
{
    int sum = 0; 
    while (N)
    {#include <iostream>

using namespace std;

int main()
{
    int 
        sum += N%10;
	N /= 10;
    }	
    return sum;
}

int main()
{
    int N;
    cin >> N;
    if (N%10 == 0)
	cout << 10;
    else
	cout << sumofDigits(N);
    return 0;
} 

Compiler output:
a.cc:9:6: error: stray '#' in program
    9 |     {#include <iostream>
      |      ^
a.cc: In function 'int sumofDigits(int)':
a.cc:9:7: error: 'include' was not declared in this scope
    9 |     {#include <iostream>
      |       ^~~~~~~
a.cc:9:24: error: expected primary-expression before '>' token
    9 |     {#include <iostream>
      |                        ^
a.cc:11:1: error: expected primary-expression before 'using'
   11 | using namespace std;
      | ^~~~~
a.cc:13:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   13 | int main()
      |         ^~
a.cc:13:9: note: remove parentheses to default-initialize a variable
   13 | int main()
      |         ^~
      |         --
a.cc:13:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:14:1: error: a function-definition is not allowed here before '{' token
   14 | {
      | ^
a.cc:22:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   22 | int main()
      |         ^~
a.cc:22:9: note: remove parentheses to default-initialize a variable
   22 | int main()
      |         ^~
      |         --
a.cc:22:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:23:1: error: a function-definition is not allowed here before '{' token
   23 | {
      | ^
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
a.cc:31:2: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      |  ^
Language: C++

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

int cal (int x){
    string c = to_string(x);
    int count = 0;
    for(int i=0;i<c.size();i++){
        count = c[i] - '0' + count;
    }
    return count;
}

int main(){
    int N;
    cin>> N;
    int min = INT_MAX;
    for(int i=N;i>0;i= i-10){
        int p = N -i;
        int q = i;
        int x = cal(p) + cal(q);
        //cout << x <<"\n";
        if(min>x){
            if(q!=N) {
                min = x;
            }
        }
    }
    cout << min <<"\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:15: error: 'INT_MAX' was not declared in this scope
   17 |     int min = INT_MAX;
      |               ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <algorithm>
  +++ |+#include <climits>
    3 | using namespace std;
Language: C++

#include <iostream>
using namespace std;

long long N;

int 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 i = 1; i < N; ++i) {
            int j = N - i;
            long long tmp = calc(i) + calc(j);
            chmin(res, tmp);
        }
        cout << res << endl;
    }
}






















Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: 'chmin' was not declared in this scope
   21 |             chmin(res, tmp);
      |             ^~~~~
Language: C++

#include <iostream>


using namespace std;

int sum_rank(int n){
  int n5 = n / 10000;
  n -= n5*10000;
  int n4 = n / 1000;
  n -= n4*1000;
  int n3 = n / 100;
  n -= n3*100;
  int n2 = n / 10;
  int n1 = n - n2*10;
  return n5+n4+n3+n2+n1;


int main(){
  int N;
  cin >> N;
  
  int sum_min = 10000;
  for (int a = 1; a <= (N+1)/2; a++){
    int b = N - a;
    sum_min = min(sum_min,sum_rank(a)+sum_rank(b));
  }
  
  cout << sum_min << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int sum_rank(int)':
a.cc:18:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   18 | int main(){
      |         ^~
a.cc:18:9: note: remove parentheses to default-initialize a variable
   18 | int main(){
      |         ^~
      |         --
a.cc:18:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:18:11: error: a function-definition is not allowed here before '{' token
   18 | int main(){
      |           ^
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:6:20: note: to match this '{'
    6 | int sum_rank(int n){
      |                    ^
Language: C++

#include <iostream>


using namespace std;

int sum_rank(n){
  int n5 = n / 10000;
  n -= n5*10000;
  int n4 = n / 1000;
  n -= n4*1000;
  int n3 = n / 100;
  n -= n3*100;
  int n2 = n / 10;
  int n1 = n - n2*10;
  return n5+n4+n3+n2+n1;


int main(){
  int N;
  cin >> N;
  
  int sum_min = 10000;
  for (int a = 1; a <= (N+1)/2; a++){
    int b = N - a;
    sum_min = min(sum_min,sum_rank(a)+sum_rank(b));
  }
  
  cout << sum_min << endl;
  return 0;
}


Compiler output:
a.cc:6:14: error: 'n' was not declared in this scope
    6 | int sum_rank(n){
      |              ^
Language: C++

a=sum(map(int,input()));print(a if a>1 else 10)

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a=sum(map(int,input()));print(a if a>1 else 10)
      | ^
a.cc:1:30: error: expected constructor, destructor, or type conversion before '(' token
    1 | a=sum(map(int,input()));print(a if a>1 else 10)
      |                              ^
Language: Java

import java.io.*;
import java.util.*;

public class Temp {
	public static InputReader scn = new InputReader();
	public static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) throws Exception {
		
		int n = scn.nextInt(), min = n;
		for(int i = 1; i <= n / 2; i++) {
			min = Math.min(min, getS(i) + getS(n - i));
		}
		out.println(min);
		out.flush();
	}

	public static int getS(int n) {
		int rv = 0;
		while(n != 0) {
			rv += n % 10;
			n /= 10;
		}
		return rv;
	}
	
	public static class InputReader {
		InputStream is;

		public InputReader() {
			is = System.in;
		}

		byte[] inbuf = new byte[1024];
		public int lenbuf = 0, ptrbuf = 0;

		int readByte() {
			if (lenbuf == -1)
				throw new InputMismatchException();
			if (ptrbuf >= lenbuf) {
				ptrbuf = 0;
				try {
					lenbuf = is.read(inbuf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return -1;
			}
			return inbuf[ptrbuf++];
		}

		boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}

		int skip() {
			int b;
			while ((b = readByte()) != -1 && isSpaceChar(b))
				;
			return b;
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		char nextChar() {
			return (char) skip();
		}

		String next() {
			int b = skip();
			StringBuilder sb = new StringBuilder();
			while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		char[] next(int n) {
			char[] buf = new char[n];
			int b = skip(), p = 0;
			while (p < n && !(isSpaceChar(b))) {
				buf[p++] = (char) b;
				b = readByte();
			}
			return n == p ? buf : Arrays.copyOf(buf, p);
		}

		char[][] nextMatrix(int n, int m) {
			char[][] map = new char[n][];
			for (int i = 0; i < n; i++)
				map[i] = next(m);
			return map;
		}

		int[] nextArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		int nextInt() {
			int num = 0, b;
			boolean minus = false;
			while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
				;
			if (b == '-') {
				minus = true;
				b = readByte();
			}

			while (true) {
				if (b >= '0' && b <= '9') {
					num = num * 10 + (b - '0');
				} else {
					return minus ? -num : num;
				}
				b = readByte();
			}
		}

		long nextLong() {
			long num = 0;
			int b;
			boolean minus = false;
			while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
				;
			if (b == '-') {
				minus = true;
				b = readByte();
			}

			while (true) {
				if (b >= '0' && b <= '9') {
					num = num * 10 + (b - '0');
				} else {
					return minus ? -num : num;
				}
				b = readByte();
			}
		}
	}
}


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

#include <bits/stdc++.h>
using namespace std;
int main(){
    int a;
    cin >> a;
    for(int i = 1;i < 6;i++) if(a == pow(10, i)){
        cout << 10;
        return 0;
    }
    cout << a / 1e6 % 10 + a / 1e5 % 10 + a / 1e4 % 10 + a / 1e3 % 10  + a / 1e1 % 10 + a / 1e0 % 10;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   10 |     cout << a / 1e6 % 10 + a / 1e5 % 10 + a / 1e4 % 10 + a / 1e3 % 10  + a / 1e1 % 10 + a / 1e0 % 10;
      |             ~~~~~~~ ^ ~~
      |               |       |
      |               double  int
a.cc:10:36: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   10 |     cout << a / 1e6 % 10 + a / 1e5 % 10 + a / 1e4 % 10 + a / 1e3 % 10  + a / 1e1 % 10 + a / 1e0 % 10;
      |                            ~~~~~~~ ^ ~~
      |                              |       |
      |                              double  int
a.cc:10:51: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   10 |     cout << a / 1e6 % 10 + a / 1e5 % 10 + a / 1e4 % 10 + a / 1e3 % 10  + a / 1e1 % 10 + a / 1e0 % 10;
      |                                           ~~~~~~~ ^ ~~
      |                                             |       |
      |                                             double  int
a.cc:10:66: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   10 |     cout << a / 1e6 % 10 + a / 1e5 % 10 + a / 1e4 % 10 + a / 1e3 % 10  + a / 1e1 % 10 + a / 1e0 % 10;
      |                                                          ~~~~~~~ ^ ~~
      |                                                            |       |
      |                                                            double  int
a.cc:10:82: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   10 |     cout << a / 1e6 % 10 + a / 1e5 % 10 + a / 1e4 % 10 + a / 1e3 % 10  + a / 1e1 % 10 + a / 1e0 % 10;
      |                                                                          ~~~~~~~ ^ ~~
      |                                                                            |       |
      |                                                                            double  int
a.cc:10:97: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   10 |     cout << a / 1e6 % 10 + a / 1e5 % 10 + a / 1e4 % 10 + a / 1e3 % 10  + a / 1e1 % 10 + a / 1e0 % 10;
      |                                                                                         ~~~~~~~ ^ ~~
      |                                                                                           |       |
      |                                                                                           double  int
Language: C++

#include<bits/stdc++.h>
using namespace std;
int ans;
int xt(int a)
{
int ab=0;
while(a)
{
ab+=a%10;
a/=10;
}return ab;}
int main()
{
int n;
cin>>n;
int m=n/2;
for(int i=1;i<=m;i++)
ans=

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: expected primary-expression at end of input
   18 | ans=
      |     ^
a.cc:18:5: error: expected '}' at end of input
a.cc:13:1: note: to match this '{'
   13 | {
      | ^
Language: C++

#include <stdio.h>

int main()
{
int sum,a,b,result=0;
scanf("%d",&sum);
for(a=0;a<sum-a;a++)
 {
   printf("%d  ",a);
   b=sum-a; //a<b
   printf("%d\n",b);

     if(b>=0&&b<10)
     {
      printf("%d\n",a+b);
         if(result<a+b)
       result=a+b;
     }
       if(b>=10&&b<100)
    {
     printf("%d\n",int(a/10)+int(b/10)+(a-(int (a/10))*10)+(b-(int (b/10))*10));
    
   if(result<int(a/10)+int(b/10)+(a-(int (a/10))*10)+(b-(int (b/10))*10))
       result=int(a/10)+int(b/10)+(a-(int (a/10))*10)+(b-(int (b/10))*10)
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:74: error: expected ';' before '}' token
   24 |        result=int(a/10)+int(b/10)+(a-(int (a/10))*10)+(b-(int (b/10))*10)
      |                                                                          ^
      |                                                                          ;
   25 |     }
      |     ~
Language: C++

#include<iostream>
using namespace std;
int ck(int);

int main(void){
    int n = 0;
    cin>>n;
    int x = 1;
    int y = n-1;
    int xa = ck(x);
    int ya = ck(y);
    int ans = xa+ya;
    int i = 0;

    for(i=0; i++; i<n-1){
      x = x+1;
      y = y-1;
    if(ans > xa+ya){
        ans = ya+xa;
      }
    }
  
  cout<<num<<endl;
  return(0);
}

int ck(int x){
  int xa[5];
  xa[1] = floor(x/100000));
  xa[2] = floor((x-xa[1]*100000)/10000);
  xa[3] = floor((x-xa[1]*100000-xa[2]*10000)/1000);
  xa[4] = floor((x-xa[1]*100000-xa[2]*10000-xa[3]*1000)/100);
  xa[5] = floor((x-xa[1]*100000-xa[2]*10000-xa[3]*1000-xa[4]*100)/10);
  xa[6] = floor((x-xa[1]*100000-xa[2]*10000-xa[3]*1000-xa[4]*100-xa[5]*10));
  return(xa[1]+xa[2]+xa[3]+xa[4]+xa[5]+xa[6]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'num' was not declared in this scope; did you mean 'enum'?
   23 |   cout<<num<<endl;
      |         ^~~
      |         enum
a.cc: In function 'int ck(int)':
a.cc:29:11: error: 'floor' was not declared in this scope
   29 |   xa[1] = floor(x/100000));
      |           ^~~~~
Language: C++

#include<iostream>
using namespace std;
int ck(int)

int main(void){
	int n = 0;
    cin>>n;
	int x = 1;
	int y = n-1;
    int xa = ck(x);
    int ya = ck(y);
	int ans = xa+ya;
	int i = 0;

	for(i=0; i++; i<n-1){
      x = x+1;
      y = y-1;
  	  if(ans > xa+ya){
        ans = ya+xa;
      }
	}
  
  cout<<num<<endl;
  return(0);
}

int ck(int x){
  int xa[5];
  xa[1] = floor(x/100000));
  xa[2] = floor((x-xa[1]*100000)/10000);
  xa[3] = floor((x-xa[1]*100000-xa[2]*10000)/1000);
  xa[4] = floor((x-xa[1]*100000-xa[2]*10000-xa[3]*1000)/100);
  xa[5] = floor((x-xa[1]*100000-xa[2]*10000-xa[3]*1000-xa[4]*100)/10);
  xa[6] = floor((x-xa[1]*100000-xa[2]*10000-xa[3]*1000-xa[4]*100-xa[5]*10));
  return(xa[1]+xa[2]+xa[3]+xa[4]+xa[5]+xa[6]);
}

Compiler output:
a.cc:5:1: error: expected initializer before 'int'
    5 | int main(void){
      | ^~~
a.cc: In function 'int ck(int)':
a.cc:29:11: error: 'floor' was not declared in this scope
   29 |   xa[1] = floor(x/100000));
      |           ^~~~~
Language: C++

#include <instream>
using namespace std;
int main();
{
            int a,b,n,i,o;
            int ans;
            cin>>n;
            if(2<=n<=100000)  ans=a+b;
            while(num){
            i=num;
            o=dig;                           
            o=i%10;
            sum=sum+o;
            i=i/10;
            i=a;
            }
            while(num){
            dig=num%10;
            sum=sum+dig;
　　　 num=num/10;
            num=b
            }
            cout<<ans<<endl;
}

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

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

#define C getchar()
#define mod 998244353

inline long long read()
{
    long long x=0;
    char ch;
    bool flag=true;
    for(;ch>'9'||ch<'0';ch=C)
    if(ch=='-')
    flag=false;
    for(;ch>='0'&&ch<='9';ch=C)
    x=(x<<3)+(x<<1)+(ch^48);
    return flag?x:-x;
}

long long n,k;
long long red,blue,green;

void intt()
{
    n=read();
    red=read();
    bule=read();
    k=read();
    green=red+blue;
    if(n*grenn<k)
    {
        printf("%d",0);
        exit(0);
    }
}

long long rec(long long buity,long long cheng)
{
    if(cheng>n||buity>k)
      return 0;
    if(cheng==n&&buity==k)
      return 1;
    long long k1=rec(buity+blue,cheng+1)%mod;
    long long k2=rec(buity+green,cheng+1)%mod;
    long long k3=rec(buity+red,cheng+1)%mod;
    long long k4=rec(buity,cheng+1)%mod;
    return (k1+k2+k3+k4)%mod;
}

int main()
{
    intt();
    if(k==0)
    {
    	printf("%d",1);
    	return 0;
    }
    printf("%lld",rec(0,0)%mod);
    return 0;
}

Compiler output:
a.cc: In function 'void intt()':
a.cc:27:5: error: 'bule' was not declared in this scope; did you mean 'blue'?
   27 |     bule=read();
      |     ^~~~
      |     blue
a.cc:30:10: error: 'grenn' was not declared in this scope; did you mean 'green'?
   30 |     if(n*grenn<k)
      |          ^~~~~
      |          green
Language: C++

/*
for (long long i = 0; i < N; ++i){}
 
// 各桁の和を計算する関数
long long findSumOfDigits(long long n) {
  long long sum = 0;
  while (n > 0) { // n が 0 になるまで
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
 
sort(a, a + N, greater<long long>());  // a[0:N] を大きい順にソート
 
long long num[110] = {0};  // バケット
for (long long i = 0; i < N; ++i) {
    num[d[i]]++;  // d[i] が 1 個増える
}
 
map<string, long long> mp; // 連想配列 map<キー型, 値型> オブジェクト名
for (long long i = 0; i < N; ++i) {
    auto itr = mp.find(s[i]);        // s[i] が設定されているか？
    if(itr != mp.end() ) {
         mp[s[i]] += 1;
    }
    else {
         mp[s[i]] += 1 ;
    }
}
 
 
*/
#include <iostream>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <algorithm>
 
using namespace std;

long long main() {
	// 入力
    long long N;
    cin >> N;
    long long L[N], R[N];
    for (long long i = 0; i < N; ++i) cin >> L[i] >>R[i];
 
 
    sort(L, L + N, greater<long long>());  // a[0:N] を大きい順にソート
    sort(R, R + N);  // a[0:N] を大きい順にソート
    long long i = 0;
    long long place = 0;
    long long distance = 0;
    //cout << "=> " << place << " dis " << distance << endl; 
    while (true){
    	if (L[i]<=place){
    		distance += 0 - place;
    		place = 0;
    		// cout << "=> " << place << " dis " << distance << endl; 
    		break;	
    	} 
    	else{
    		// cout << "L[" << i << "]: " << L[i] << endl;
    		distance += L[i] - place;
    		place = L[i];
    		// cout << "=> " << place << " dis " << distance << endl; 
    	}
    	if (R[i]>=place){
    		distance += place;
    		place = 0;
    		// cout << "=> " << place << " dis " << distance << endl; 
    		break;	
    	} 
    	else{
    		distance += place - R[i];
    		place = R[i];
    		// cout << "=> " << place << "dis " << distance << endl; 
    	}
    	++i;
    }
    

	//出力
    cout << distance << endl;
}
 
 

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <bits/stdc++.h>
int st[20],tot;
int n;
int main( ){
	int sum=0,digit=0;
	cin>>n;
	int x=n;
	while(x) {
		if(x>10&&x%10) digit=1;
		sum+=x/10;
		sum/=10;
	}
	if(!digit&&sum==1) puts("10");
	else puts("sum"); 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin>>n;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C++

#include <bits/stdc++.h>
int st[20],tot;
int n;
int main( ){
	int sum=0,digit=0;
	while(x) {
		if(x>10&&x%10) digit=1;
		sum+=x/10;
		sum/=10;
	}
	if(!digit&&sum==1) puts("10");
	else puts("sum"); 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: 'x' was not declared in this scope
    6 |         while(x) {
      |               ^
Language: C++

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

int digitsSum(int number) {
  string number_string = to_string(number);
  int digits_sum = 0;
  for (char c : number_string) {
    digits_sum += c - 48;
  }
  return digits_sum;
}

void solve() {
  int N;
  cin >> N;
  int min_digits_sum = numeric_limits<int>::max();
  for (int a = 1; a < N; ++a) {
    int b = N - a;
    int digits_sum = digitsSum(a) + digitsSum(b);
    min_digits_sum = min(min_digits_sum, digits_sum);
  }
  cout << min_digits_sum << endl;
}

Compiler output:
/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