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

import java.util.*;

class Main {
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String out = "";
        if(s.length == 1) {
            System.out.println(s);
        } else {
            if(s.charAt(0) != '1')
            out += String.valueOf(((char)(s.charAt(0) - 1)));
            for(int i = 1; i < s.length(); i++) {
                out += "9";
            }
            int ans = 0;
            for(int i = 0; i < out.length(); i++) {
                ans += out.charAt(i) - '0';
            }
            System.out.println(ans);
    
        }

    }
}



Compiler output:
Main.java:9: error: cannot find symbol
        if(s.length == 1) {
            ^
  symbol:   variable length
  location: variable s of type String
1 error
Language: C++

#include "stdafx.h"
#include "iostream"
#include "math.h"
using namespace std;

int main()
{
	long long int n,c;
	cin >> n;
	c = n + 1;
	int a = 0;
	while (c > 10) {
		c = c / 10;
		a++;
	}
	 int b = a * 9 + (n + 1) / (pow(10, a)) - 1;
	cout << b << endl;

	return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	string s;
	cin >> s;
	int n = s.size();
	int ans = 0, change = 0;
	for(int i = 1 i < n; ++i){
		if(s[i] != '9')
			change++;
		ans += s[i] - '0';
	}
	ans += s[0]-'0';
	if(change)
		cout << ans-1 << '\n';
	else
		cout << ans << '\n';

}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: expected ';' before 'i'
    9 |         for(int i = 1 i < n; ++i){
      |                      ^~
      |                      ;
Language: C

#include<iostream>
#include<string.h>
#include<cstdio>
using namespace std;
int main()
{
long long n;
char buff[30];
cin>>n;
sprintf(buff,"%I64d",n);
buff[0]--;
for(int i=1;i<strlen(buff);i++)
buff[i]='9';
sscanf(buff,"%I64d",&n);
cout<<n;
return 0;
}

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

#include<bits/stdc++.h>
typedef long long int ll;
string s;

int main(void){
  cin >> s;
  cout << 9 * (s.size() - 1) + (s[0] - '1') << endl;
  return 0;
}


Compiler output:
a.cc:3:1: error: 'string' does not name a type; did you mean 'stdin'?
    3 | string s;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> s;
      |   ^~~
      |   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
      |                  ^~~
a.cc:6:10: error: 's' was not declared in this scope
    6 |   cin >> s;
      |          ^
a.cc:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   cout << 9 * (s.size() - 1) + (s[0] - '1') << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:7:48: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |   cout << 9 * (s.size() - 1) + (s[0] - '1') << endl;
      |                                                ^~~~
      |                                                std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
typedef long long int ll;
string s;
int main(void){
  cin >> s;
  cout << 9 * (s.size() - 1) + (s[0] - '1') << endl;
  return 0;
}


Compiler output:
a.cc:3:1: error: 'string' does not name a type; did you mean 'stdin'?
    3 | string s;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >> s;
      |   ^~~
      |   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
      |                  ^~~
a.cc:5:10: error: 's' was not declared in this scope
    5 |   cin >> s;
      |          ^
a.cc:6:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |   cout << 9 * (s.size() - 1) + (s[0] - '1') << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:48: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |   cout << 9 * (s.size() - 1) + (s[0] - '1') << endl;
      |                                                ^~~~
      |                                                std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main4 {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		String inputNum = scanner.nextLine();
		String[] digitStr = inputNum.split("");

		List<Integer> numArray = new ArrayList<>();

		for (String str : digitStr) {
			numArray.add(Integer.parseInt(str));
		}

		int firstNum = numArray.get(0);

		int maxSum = 0;

		for (int i = 1; i < numArray.size(); i++) {

			maxSum += 9;

		}
		maxSum += firstNum - 1;
		System.out.println(maxSum);

	}

}

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

#include<bits/stdc++.h>
using namespace std;  
inline int read()  
{  
    int x=0,f=1;
    char s=getchar();  
    while(s<'0'||s>'9')
        {
            if(s=='-')
                f=-1;
            s=getchar();
        }  
    while(s<='9'&&s>='0')
        {
            x=x*10+s-'0';
            s=getchar();
        }  
    return x*f;  
}  
int main()  
{  
    char ch[50];  
    scanf("%s",ch);  
    bool flag=true;  
    for(int i=1;i<strlen(ch);i++)  
        if(ch[i]!='9')
            flag=false;  
    if(flag)
        printf("%d\n",(strlen(ch)-1)*9+ch[0]-'0');
    else  
        printf("%d\n",(strlen(ch)-1)*9+ch[0]-'0'-1);  
    return 0;  
}  

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

#include <iostream>

#

using namespace std;

int main() {
    long long a;
    cin >> a;
    if (a < 10) {
        cout << a << endl;
    } else {
        int flag = 0;
        if ((a + 1) % 10 == 0) {
            flag = 1;
        }
        int y;
        int count = 0;
        while (a > 9) {
            a /= 10;
            count++;
        }
        if (flag != 1) { y = a - 1; }
        else {
            y=a;
        }

        cout << 9 * count + y << endl;
    }

    return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:3: error: illegal character: '#'
#
^
Main.java:8: error: not a statement
    long long a;
    ^
Main.java:9: error: not a statement
    cin >> a;
        ^
Main.java:11: error: not a statement
        cout << a << endl;
                  ^
Main.java:28: error: not a statement
        cout << 9 * count + y << endl;
                              ^
Main.java:7: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:8: error: ';' expected
    long long a;
        ^
8 errors
Language: C++

import java.io.*;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(new BufferedInputStream(System.in));
        char[] ch = sc.next().toCharArray();
        boolean flag = false;
        int sum=0;
        for (int i = ch.length - 1; i >= 1; i--) {
            if(ch[i]!='9'){
                flag=true;
            }
            sum+=9;
        }
        sum+=(ch[0]-'0');
        if(flag){
            sum--;
        }
        System.out.println(sum);
    }
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Arrays;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.Scanner;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Main {
      | ^~~~~~
Language: C++

import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String x = sc.next();
        ArrayList<Integer> digits = new ArrayList<>();
        for (char i : x.toCharArray()) {
            digits.add(i - '0');
        }
        int ans = digits.stream().mapToInt(i -> i).sum();
        for (int i = 0; i < x.length(); i++) {
            if (digits.get(i) != 0) {
                ans = Math.max(ans, digits.stream().limit(i).mapToInt(j -> j).sum() + digits.get(i) - 1 + (x.length() - i - 1) * 9);
            }
        }
        System.out.println(ans);
    }
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.ArrayList;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main {
      | ^~~~~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main(){
double N,S,j,K,L,g,i;
scanf(“%lf16.16”,&N);
L=1;
for(i=1;i<=N;i=i+1){
g=i;
 for(j=1;j<=17;j=j+1){
K=g/pow(10,17-j);
g=g-(17-j)*K;
S=S+K;
}
if(L<S)
L=S;
}
printf(“%lf16.16”,L);
return 0;
}


Compiler output:
a.cc:6:7: error: extended character “ is not valid in an identifier
    6 | scanf(“%lf16.16”,&N);
      |       ^
a.cc:6:13: error: extended character ” is not valid in an identifier
    6 | scanf(“%lf16.16”,&N);
      |             ^
a.cc:18:8: error: extended character “ is not valid in an identifier
   18 | printf(“%lf16.16”,L);
      |        ^
a.cc:18:14: error: extended character ” is not valid in an identifier
   18 | printf(“%lf16.16”,L);
      |              ^
a.cc: In function 'int main()':
a.cc:6:7: error: '\U0000201c' was not declared in this scope
    6 | scanf(“%lf16.16”,&N);
      |       ^
a.cc:6:9: error: 'lf16' was not declared in this scope
    6 | scanf(“%lf16.16”,&N);
      |         ^~~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main(){
double N,S,j,K,L,g,i;
scanf(“%16.16lf”,&N);
L=1;
for(i=1;i<=N;i=i+1){
g=i;
 for(j=1;j<=17;j=j+1){
K=g/pow(10,17-j);
g=g-(17-j)*K;
S=S+K;
}
if(L<S)
L=S;
}
printf(“%16.16lf”,L);
return 0;
}


Compiler output:
a.cc:6:7: error: extended character “ is not valid in an identifier
    6 | scanf(“%16.16lf”,&N);
      |       ^
a.cc:6:9: error: extended character ” is not valid in an identifier
    6 | scanf(“%16.16lf”,&N);
      |         ^
a.cc:18:8: error: extended character “ is not valid in an identifier
   18 | printf(“%16.16lf”,L);
      |        ^
a.cc:18:10: error: extended character ” is not valid in an identifier
   18 | printf(“%16.16lf”,L);
      |          ^
a.cc: In function 'int main()':
a.cc:6:7: error: '\U0000201c' was not declared in this scope
    6 | scanf(“%16.16lf”,&N);
      |       ^
a.cc:6:9: error: unable to find numeric literal operator 'operator""lf\U0000201d'
    6 | scanf(“%16.16lf”,&N);
      |         ^~~~~~~~
a.cc:18:10: error: unable to find numeric literal operator 'operator""lf\U0000201d'
   18 | printf(“%16.16lf”,L);
      |          ^~~~~~~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main(){
int N,S,j,K,L,g,i;
scanf(“%d”,&N);
L=1;
for(i=1;i<=N;i=i+1){
g=i;
 for(j=1;j<=17;j=j+1){
K=g/pow(10,17-j);
g=g-(17-j)*K;
S=S+K;
}
if(L<S)
L=S;
}
printf(“%d”,L);
return 0;
}

Compiler output:
a.cc:6:7: error: extended character “ is not valid in an identifier
    6 | scanf(“%d”,&N);
      |       ^
a.cc:6:9: error: extended character ” is not valid in an identifier
    6 | scanf(“%d”,&N);
      |         ^
a.cc:18:8: error: extended character “ is not valid in an identifier
   18 | printf(“%d”,L);
      |        ^
a.cc:18:10: error: extended character ” is not valid in an identifier
   18 | printf(“%d”,L);
      |          ^
a.cc: In function 'int main()':
a.cc:6:7: error: '\U0000201c' was not declared in this scope
    6 | scanf(“%d”,&N);
      |       ^
a.cc:6:9: error: 'd\U0000201d' was not declared in this scope
    6 | scanf(“%d”,&N);
      |         ^~
Language: C++

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

int main() {
  string N;
  cin >> N;

  int ans = 0;
  int cnt = 0;
  for (int i = 0; i < N.size(); ++i) {
    int x = N[i] - '0';
    if (x) ans = max(ans, cnt + x - 1 + ((int)N.size() - i - 1) * 9);
    cnt += x;
  }

  ans = max(ana, cnt);

  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: 'ana' was not declared in this scope; did you mean 'ans'?
   16 |   ans = max(ana, cnt);
      |             ^~~
      |             ans
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

int main(){
long long N;
cin>>N;
int ans=0;
for(int i=1;i<=N;i++)
{
int tmp=0;
while(1){
tmp+=(i%10);
i=i/10;
if(i<10){
tmp+=i;
break;
}
ans=max(ans,tmp);
}

cout<<ans<<endl;

return 0;
}

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

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
typedef long long ll;

using namespace std;

int main()
{
	ll n;
	ll keta;
	ll temp;
	ll ans=0;
	
	cin>>n;
	keta = pow(10,(int)log10(n));
	temp = (n/keta)*keta; //nと最上位の数字が同じかつnを超えない最小の整数を求める
	temp--;
	if(temp+keta==n)
	{
		tenp+=keta;
	}
	while(temp!=0)
	{
		ans += temp%10;
		temp/=10;
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: 'tenp' was not declared in this scope; did you mean 'temp'?
   23 |                 tenp+=keta;
      |                 ^~~~
      |                 temp
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <math.h>


int GetDigit(double num){
	return log10(num) + 1;
}

int main(void)
{	
	double a;
	
	int max = 0;

	if (scanf("%lf", &a)==1);
	int num_1 = GetDigit(a);
	if (num_1 == 1){
		max = int(a);
	}
	else{
		num_1 = (int)a / (10 * (num_1 - 1));
		int i_copy = num_1*(10 * (num_1 - 1)) - 1;
		for (int j = 0; j < GetDigit(i_copy); j++){
			max += i_copy % 10;
			i_copy /= 10;
		}
	}

	printf("%d\n",max);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:23: error: expected expression before 'int'
   19 |                 max = int(a);
      |                       ^~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <math.h>


int GetDigit(double num){
	return log10(num) + 1;
}

int main(void)
{	
	double a;
	
	int max = 0;

	if (scanf("%lf", &a)==1);
	int num_1 = GetDigit(a);
	if (num_1 == 1){
		max = int(a);
	}
	else{
		num_1 = (int)a / (10 * (num_1 - 1));
		int i_copy = num_1*(10 * (num_1 - 1)) - 1;
		for (int j = 0; j < GetDigit(i_copy); j++){
			max += i_copy % 10;
			i_copy /= 10;
		}
	}

	printf("%d\n",max);

	return 0;


Compiler output:
main.c: In function 'main':
main.c:19:23: error: expected expression before 'int'
   19 |                 max = int(a);
      |                       ^~~
main.c:32:9: error: expected declaration or statement at end of input
   32 |         return 0;
      |         ^~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <math.h>


int GetDigit(int num){
	int digit = 0;
	while (num != 0){
		num /= 10;
		digit++;
	}
	return digit;
}

int main(void)
{	
	unsigned __int64 a;
	

	int sum = 0;
	int max = 0;
	scanf("%d", &a);


	for (int i = 0; i <= a; i++){
		int num = GetDigit(i);
		int i_copy = i;
		for (int j = 0; j < num; j++){
			sum += i_copy % 10;
			i_copy /= 10;
		}
		
		if (sum > max){
			max = sum;
		}
		sum = 0;
	}
	
	printf("%d\n",max);

	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:17:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a'
   17 |         unsigned __int64 a;
      |                          ^
main.c:17:26: error: 'a' undeclared (first use in this function)
main.c:17:26: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

//
//  main.cpp
//  atcoder
//
//  Created by Niko Huang on 2018/02/28.
//  Copyright © 2018年 Niko Huang. All rights reserved.
//

#include <iostream>
#include <string>

using namespace std;

int main(int argc, const char * argv[]) {
    // insert code here...
    
    string input;
    
    cin >> input;
    
    char* num = new char[input.length() + 1];
    strcpy(num, input.c_str());
    
    unsigned long size = input.size();
    int temp;
    
    temp = num[0] - '0';
    int result = 0;
    result += temp;
    
    for(int i = 1; i < size; i++){
        temp = num[i] - '0';
        
        if(temp == 9) {
            result += temp;
            continue;
        } else {
            result--;
            result += 9 * (size - i);
            break;
        }
    }
    
    cout << result << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:22:5: error: 'strcpy' was not declared in this scope
   22 |     strcpy(num, input.c_str());
      |     ^~~~~~
a.cc:10:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    9 | #include <iostream>
  +++ |+#include <cstring>
   10 | #include <string>
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iomanip>
#include<vector>
#include<queue>
#include<deque>
#include<string>
#include<utility>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<set>
#include<map>
#include<bitset>
#include<stack>
#include<ctime>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<pli> vpli;

#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file freopen("out.out","w",stdout);
#define RE cout<<233<<endl;
#define Tnum(x) cout<<x<<endl;
#define Tall(x,n) for(int i=0;i<n;i++)cout<<x[i]<<(i==n-1?"\n":" ");
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REV(a) reverse(a.begin(),a.end())
#define SORT(a) sort(a.begin(),a.end())
#define inf (int)1e9
#define linf (ll)1e18
#define mod (inf+7)

string n;

int main() {
  fastio;
  cin>>n;
  if(n.size()==1){
  	cout<<n-'0'<<endl;
  	return 0;
	}
  cout<<(n.size()-1)*9+(n[0]-'1')<<endl;
  
  
  
  
  
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:16: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
   47 |         cout<<n-'0'<<endl;
      |               ~^~~~
      |               | |
      |               | char
      |               std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/string:48,
                 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_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   template argument deduction/substitution failed:
a.cc:47:17: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
   47 |         cout<<n-'0'<<endl;
      |                 ^~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   template argument deduction/substitution failed:
a.cc:47:17: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
   47 |         cout<<n-'0'<<endl;
      |                 ^~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>


int main()
{
	int i;
　	long long int N;
	int keta = 0;
	long long int tasikame = 0;
	long long int ketaketa = 1;
	int kotae = 0;

	scanf("%llu", &N);
	unsigned long long int m = N;
	while (m != 0) {
			m /= 10;
			keta++;
			tasikame += 9 * ketaketa;
			ketaketa *= 10;
	}
	ketaketa /= 10;

	while (tasikame > N) {
		tasikame -= 1 * ketaketa;
	}
	while (tasikame != 0) {
		kotae += tasikame % 10;
		tasikame /= 10;
	}

	printf("%u", kotae);
	return 0;
}
/*受け取るｎ１６けたもある時は、unsigned long long int で宣言して、%lluで受け取る。*/

Compiler output:
main.c: In function 'main':
main.c:10:1: error: stray '\343' in program
   10 | <U+3000>        long long int N;
      | ^~~~~~~~
Language: C++

#include<iostream>
#include<ios>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<vector>

#define ll long long

using namespace std;

ll N;
int digit = 1;
ll pow_10 = 10;
int sum = 0;
int num;
bool first = true;

int main()
{
    cin >> N;

    while (pow_10 < N) {
        digit ++;
        pow_10 *= 10;
    }
    
    pow_10 /= 10;

   for (digit; digit>0; digit--) {
        num = N / pow_10_a;
        if (num < 9 && !first) {
            sum += 9 * digit - 1;
            break;
        } else { 
            sum += num;
            N -= num * pow_10;
            pow_10 /= 10;
            first = false;
        }
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:31:19: error: 'pow_10_a' was not declared in this scope; did you mean 'pow_10'?
   31 |         num = N / pow_10_a;
      |                   ^~~~~~~~
      |                   pow_10
Language: C++

#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
#define int ll
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define PB push_back

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const int MOD = 1000000007;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template <typename T> bool IN(T a, T b, T x) { return a<=x&&x<b; }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }
template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a){
  out<<'('<<a.first<<','<<a.second<<')';
  return out;
}
template<class T>
ostream &operator <<(ostream& out,const vector<T>& a){
  out<<'[';
  REP(i, a.size()) {out<<a[i];if(i!=a.size()-1)out<<',';}
  out<<']';
  return out;
}

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};

signed main(void)
{
  string s;
  cin >> s;

  if(s.size() == 1) {
    cout << s << endl;
    return 0;
  }

  int ret = 0;
  REP(i, s.size()) ret += s[i]-'0';
  if(s[0] == '0') chmax(ret, (s.size()-1)*9LL);
  else chmax(ret, s[0]-'0'-1 + (s.size()-1)*9LL);
  cout << ret << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:24: error: no matching function for call to 'chmax(ll&, long long unsigned int)'
   51 |   if(s[0] == '0') chmax(ret, (s.size()-1)*9LL);
      |                   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:21:26: note: candidate: 'template<class T> T& chmax(T&, const T&)'
   21 | template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
      |                          ^~~~~
a.cc:21:26: note:   template argument deduction/substitution failed:
a.cc:51:24: note:   deduced conflicting types for parameter 'const T' ('long long int' and 'long long unsigned int')
   51 |   if(s[0] == '0') chmax(ret, (s.size()-1)*9LL);
      |                   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:52:13: error: no matching function for call to 'chmax(ll&, long long unsigned int)'
   52 |   else chmax(ret, s[0]-'0'-1 + (s.size()-1)*9LL);
      |        ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:21:26: note: candidate: 'template<class T> T& chmax(T&, const T&)'
   21 | template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
      |                          ^~~~~
a.cc:21:26: note:   template argument deduction/substitution failed:
a.cc:52:13: note:   deduced conflicting types for parameter 'const T' ('long long int' and 'long long unsigned int')
   52 |   else chmax(ret, s[0]-'0'-1 + (s.size()-1)*9LL);
      |        ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
#define EPS (1e-7)
#define INF (2e9)
#define PI (acos(-1))

int main() {
	long int N, p = 9, q = 1, r = 9;
	int sum = 0, i;

	scanf("%d", &N);

	for (i = 0; i <= 16; i++){
		if (N > p){
			sum += 9;
		}
		else{
			sum += ((N -p+9*pow(10,i))/q);
			break;
		}
		p += (9 * pow(10, i+1));
		q = q * 10;
	}
		printf("%d", sum);
	


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:41: error: 'pow' was not declared in this scope
   23 |                         sum += ((N -p+9*pow(10,i))/q);
      |                                         ^~~
a.cc:26:27: error: 'pow' was not declared in this scope
   26 |                 p += (9 * pow(10, i+1));
      |                           ^~~
Language: C++

#include <cstdio>

int main() {aa

    long N, tmp;
    long tm=0;
    int i=0,j=0;
    long n = 0;
   int flag = 0;
    scanf("%ld",&N);

    tm = N;
    tmp = N;
    tmp %= 10;
    if(tmp==9) {
        j++;
    }else{
       flag =1;
   }

    N = N/10;
    i++;
    if(N == 0){
        printf("%ld",tm);
        return 0;
    }
    
    while(N != 0){
        tmp = N;
        tmp %= 10;
        if(tmp==9)
            j++;
        tm = N;
        n+=9;
        N /= 10;
        i++;
    }

    if((i==j || i == j+1)&&(flag == 0)){
        n+=tm;
    }else {
        n += tm - 1;
    }



    printf("%ld", n);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:13: error: 'aa' was not declared in this scope
    3 | int main() {aa
      |             ^~
a.cc:10:18: error: 'N' was not declared in this scope
   10 |     scanf("%ld",&N);
      |                  ^
a.cc:13:5: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   13 |     tmp = N;
      |     ^~~
      |     tm
Language: C++

#include <vector>
#include <cstdio>
#include <cmath>
#include <algorithm>

using namespace std;
int main(){
    int n,x,a,c,i;

    scanf("%d" ,&n);
    x=int(log10(n));
    a=n/(pow(x,10));
    for(i=0;i<=x;i++){
        c=c+pow(i,10);
    }
    
    if((n-c)%10==0){
        printf("%d" ,(9*x+a));
    }else{
        printf("%d" ,(9*x+(a-1));
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:33: error: expected ')' before ';' token
   20 |         printf("%d" ,(9*x+(a-1));
      |               ~                 ^
      |                                 )
Language: C++

#include <vector>
#include <cstdio>
#include <cmath>
#include <algorithm>

using namespace std;
int main(){
    int n,x,a,c,i;

    scanf("%d" ,&n);
    x=int(log10(n));
    a=n/(pow(x,10));
    for(i=0;i<=x;i++){
        c=c+pow(i,10);
    }
    
    if((n-c)%10==0){
        printf("%d" ,(9*x+a);
    }else{
        printf("%d" ,(9*x+(a-1));
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:29: error: expected ')' before ';' token
   18 |         printf("%d" ,(9*x+a);
      |               ~             ^
      |                             )
a.cc:20:33: error: expected ')' before ';' token
   20 |         printf("%d" ,(9*x+(a-1));
      |               ~                 ^
      |                                 )
Language: C++

#include<iostream>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
int main()
{
    int sum,z,s;
long long n;
    while(cin>>n)
    {z=0,sum=0;
s=n;
       while(n/10)
       {
           n=n/10;
           z++;
       }
       if(n)
        sum=z*9+(n-1);
       if(n!=0&&)
        sum=z*9;
       
       cout<<sum<<endl;

    }

}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: expected primary-expression before ')' token
   21 |        if(n!=0&&)
      |                 ^
Language: C++

#include <vector>
#include <cstdio>
#include <cmath>
#include <algorithm>

using namespace std;
int main(){
    int n,x,a,c,i;

    scanf("%d" ,&n);
    x=int(log10(n));
    a=n/(pow(x,10));
    for(i=0;i<=x;i++){
 }       c=c+pow(i,10);
    }
    if((n-c)%0){
        printf("%d" ,(9*x+a);
    }else{
        printf("%d" ,(9*x+(a-1));
    }
    return 0;

Compiler output:
a.cc:16:5: error: expected unqualified-id before 'if'
   16 |     if((n-c)%0){
      |     ^~
a.cc:18:6: error: expected unqualified-id before 'else'
   18 |     }else{
      |      ^~~~
a.cc:21:5: error: expected unqualified-id before 'return'
   21 |     return 0;
      |     ^~~~~~
Language: C++

#include<iostream>
using namespace std;
int keta(long);
long nineline(int);
long kinpen(long);
long goukei(long);
int main() {
	long N;
	cin >> N;
	N = kinpen(N);
	N = goukei(N);
	cout << N;
return 0;
}
long goukei(long a) {
	long ans=0;
	int k = keta(a);
	for (int i=0; i <= k; i++) {
		ans += a % 10;
		a /= 10;
	}
	return ans;
}

int keta(long x) {
	long x1=x;
	int ans=0;
	while (1) {
		x1 /= 10;
		if (x1 == 0) {
			break;
		}
		else {
			ans++;
		}
	}
	return ans;
}
long kinpen(long a) {
	int t = keta(a);
	long tenx = pow(10, t);
	int kami1 = a / tenx;
	if ((a%tenx) == nineline(t-1)) {
		return a;
	}
	else {
		return ((kami1-1)*tenx) + nineline(t - 1);
	}
}
long nineline(int a) {
	long ans=0;
	for (int i = 0; i <= a; i++) {
		ans += 9 * pow(10, i);
	}
	return ans;
}

Compiler output:
a.cc: In function 'long int kinpen(long int)':
a.cc:41:21: error: 'pow' was not declared in this scope
   41 |         long tenx = pow(10, t);
      |                     ^~~
a.cc: In function 'long int nineline(int)':
a.cc:53:28: error: 'pow' was not declared in this scope
   53 |                 ans += 9 * pow(10, i);
      |                            ^~~
Language: C++

#include"stdio.h"
#include"stdlib.h"

int main(void)
{
	unsigned int number;
	int digit;
	int sum = 0;
	int comp = 0;

	scanf("%u", &number);
	
	for (int work = number,int count = 0; number > 0; number--,count++, work = number)
	{
		if (count > 10) { break; }
		while (work)
		{
			digit = work % 10;
			sum += digit;
			work /= 10;
		}
		if (sum > comp)
		{
			comp = sum;
			count = 0;
		}
		sum = 0;
	}

	printf("%d", comp);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:32: error: expected unqualified-id before 'int'
   13 |         for (int work = number,int count = 0; number > 0; number--,count++, work = number)
      |                                ^~~
a.cc:13:32: error: expected ';' before 'int'
   13 |         for (int work = number,int count = 0; number > 0; number--,count++, work = number)
      |                                ^~~
      |                                ;
a.cc:13:57: error: expected ')' before ';' token
   13 |         for (int work = number,int count = 0; number > 0; number--,count++, work = number)
      |             ~                                           ^
      |                                                         )
a.cc:13:68: error: 'count' was not declared in this scope
   13 |         for (int work = number,int count = 0; number > 0; number--,count++, work = number)
      |                                                                    ^~~~~
a.cc:13:77: error: 'work' was not declared in this scope
   13 |         for (int work = number,int count = 0; number > 0; number--,count++, work = number)
      |                                                                             ^~~~
Language: C++

#include <vector>
#include <cstdio>
#include <cmath>
#include <algorithm>

using namespace std;
int main(){
    int n,x,a,b;

    scanf("%d" ,&n);
    x=int(log10(n));
    a=n/(pow(x,10);
    b=9*(x-1)+(a-1);
    printf("%d",b);
    return 0

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: expected ')' before ';' token
   12 |     a=n/(pow(x,10);
      |         ~         ^
      |                   )
a.cc:15:13: error: expected ';' at end of input
   15 |     return 0
      |             ^
      |             ;
a.cc:15:13: error: expected '}' at end of input
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include <vector>
#include <cstdio>
#include <cmath>
#include <algorithm>

using namespace std;
int main(){
    int n,x,a,b;

    scanf("%d" ,&n);
    x=int(log10(n));
    a=int(n/(pow(x,10));
    b=9*(x-1)+(a-1);
    printf("%d",b);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: expected primary-expression before 'int'
   12 |     a=int(n/(pow(x,10));
      |       ^~~
Language: C++

#include <vector>
#include <cstdio>
#include <cmath>
#include <algorithm>

using namespace std;
int main(){
    int n,x,a,b;

    scanf('%d' ,&n);
    x=int(log10(n));
    a=int(n/(pow(x,10));
    b=9*(x-1)+(a-1);
    printf('%d',&b);
    return 0;.
}

Compiler output:
a.cc:10:11: warning: multi-character character constant [-Wmultichar]
   10 |     scanf('%d' ,&n);
      |           ^~~~
a.cc:14:12: warning: multi-character character constant [-Wmultichar]
   14 |     printf('%d',&b);
      |            ^~~~
a.cc: In function 'int main()':
a.cc:10:11: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   10 |     scanf('%d' ,&n);
      |           ^~~~
      |           |
      |           int
In file included from /usr/include/c++/14/cstdio:42,
                 from a.cc:2:
/usr/include/stdio.h:428:42: note:   initializing argument 1 of 'int scanf(const char*, ...)'
  428 | extern int scanf (const char *__restrict __format, ...) __wur;
      |                   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:12:7: error: expected primary-expression before 'int'
   12 |     a=int(n/(pow(x,10));
      |       ^~~
a.cc:14:12: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   14 |     printf('%d',&b);
      |            ^~~~
      |            |
      |            int
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:15:14: error: expected primary-expression before '.' token
   15 |     return 0;.
      |              ^
a.cc:16:1: error: expected unqualified-id before '}' token
   16 | }
      | ^
Language: C++

#include"stdio.h"
#include"stdlib.h"

int main(void)
{
	char c_number[18];
	unsigned int number;
	int digit;
	int sum = 0;
	int comp = 0;

	gets_s(c_number);
	number = atoi(c_number);
	
	for (int work = number; number > 0; number--, work = number)
	{
		while (work)
		{
			digit = work % 10;
			sum += digit;
			work /= 10;
		}
		if (sum > comp){comp = sum;}
		sum = 0;
	}

	printf("%d", comp);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'gets_s' was not declared in this scope
   12 |         gets_s(c_number);
      |         ^~~~~~
Language: C++

#include"stdio.h"
#include"stdlib.h"

int main(void)
{
	char c_number[18];
	unsigned int number;
	int digit;
	int sum = 0;
	int comp = 0;

	gets(c_number);
	number = atoi(c_number);
	
	for (int work = number; number > 0; number--, work = number)
	{
		while (work)
		{
			digit = work % 10;
			sum += digit;
			work /= 10;
		}
		if (sum > comp){comp = sum;}
		sum = 0;
	}

	printf("%d", comp);
	return 0;
}

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

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

ll s,cp;
int len,first;
ll read(){
	ll x=0,f=1;char c=getchar();
	while(c>'9'||c<'0'){if(c=='-')f=-1;c=getchar();}
	while(c<='9'&&c>='0'){x=x*10+c-'0';c=getchar();}
	return x*f;
}

ll cur=0;
int ans=-1;
void dfs(int num,int dep,int tot)
{
	ll power=pow(10,len-dep);
	//printf("(num=%d,dep=%d,tot=%d)\npow=%d cur=%d\n",num,dep,tot,power,cur+power*num);
	if (cur+power*num>s) return ;
	if (tot+9*(len-dep)<=ans) return ;
	cur+=power*num;
	if (dep==len){ans=max(ans,tot);return ;}
	for (int i=9;i>=0;--i)
		dfs(i,dep+1,tot+i);
	cur-=power*num;
}
int main()
{
	s=read();
	cp=s;
	len=log(s)/log(10);
	for (int i=1;i<=len;++i) cp/=10;
	first=cp;
	len++;
	
	//cur+=first*pow(10,len-1);
	for (int i=first;i>=0;--i) dfs(i,1,i);
	cout<<ans;
	return 0;
}

Compiler output:
a.cc:3:9: error: '__int64' does not name a type; did you mean '__int64_t'?
    3 | typedef __int64 ll;
      |         ^~~~~~~
      |         __int64_t
a.cc:5:1: error: 'll' does not name a type
    5 | ll s,cp;
      | ^~
a.cc:7:1: error: 'll' does not name a type
    7 | ll read(){
      | ^~
a.cc:14:1: error: 'll' does not name a type
   14 | ll cur=0;
      | ^~
a.cc: In function 'void dfs(int, int, int)':
a.cc:18:9: error: 'll' was not declared in this scope
   18 |         ll power=pow(10,len-dep);
      |         ^~
a.cc:20:13: error: 'cur' was not declared in this scope
   20 |         if (cur+power*num>s) return ;
      |             ^~~
a.cc:20:17: error: 'power' was not declared in this scope
   20 |         if (cur+power*num>s) return ;
      |                 ^~~~~
a.cc:20:27: error: 's' was not declared in this scope
   20 |         if (cur+power*num>s) return ;
      |                           ^
a.cc:22:9: error: 'cur' was not declared in this scope
   22 |         cur+=power*num;
      |         ^~~
a.cc:22:14: error: 'power' was not declared in this scope
   22 |         cur+=power*num;
      |              ^~~~~
a.cc: In function 'int main()':
a.cc:30:9: error: 's' was not declared in this scope
   30 |         s=read();
      |         ^
a.cc:30:15: error: too few arguments to function 'ssize_t read(int, void*, size_t)'
   30 |         s=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
      |                ^~~~
a.cc:31:9: error: 'cp' was not declared in this scope
   31 |         cp=s;
      |         ^~
Language: Java

import java.util.Scanner;

public class MainA {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int n = s.length();
		long ans = 0;
		for(int i = 0 ; i < s.length() - 1 ; i++) {
			if(s.charAt(i) != '9') {
				long temp = Long.valueOf(s);
				long math = Long.valueOf((s.substring(0 + i + 1))) + 1;
				ans = Math.max(ans, func(temp - math));
			}
		}
		ans = Math.max(ans, func(Long.valueOf(s) - Long.valueOf(s) % 10 - 1));
		ans = Math.max(ans, func(Long.valueOf(s)));
		System.out.println(ans);
	}

	public static long func(long x) {
		long wa = 0;
		while(x >= 1) {
			wa += x % 10;
			x = x / 10;
		}
		return wa;
	}

}


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

N = int(input())
n=0
num=[]
for i in range(N):
    s=list(str(N-i))
    for j in range(len(s)):
        n+=int(s[j])
    num.append(n)
    n=0
print(max(num))        
        


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

#include <iostream>
#include <cmath>

using namespace std;

int wa(int num)
{
  int dig = 0;
  int sum = 0;
  while (num)
  {
    if (num / 10 == 0)
    {
      sum += num;
      break;
    }
    dig = num % 10;
    if (dig != 9)
    {
      sum += 9;
      num = num / 10;
      num--;
    }
    else
    {
      sum += 9;
      num = num / 10;
    }
  }
  return sum;
}

int main()
{
  int N;
  int result = 0;
  cin >> N;
  int keta = log10(N);
  if (N / 10 == 0)
  {
    result == N;
  }
  else
  {
    result = wa(i);
  }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:45:17: error: 'i' was not declared in this scope
   45 |     result = wa(i);
      |                 ^
Language: C++

#incnlude <bits/stdc++.h>
using namespace std;
int main() {
	char a[110];
	scanf("%s", a + 1);
	int n = strlen(a + 1);
	int pp = 0;
	for(int i = 2; i <= n; i++)
		if(a[i] != '9') 
			pp = 1;
	cout << a[1] - '0' - pp + (n - 1) * 9;
	return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incnlude; did you mean #include?
    1 | #incnlude <bits/stdc++.h>
      |  ^~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:9: error: 'scanf' was not declared in this scope
    5 |         scanf("%s", a + 1);
      |         ^~~~~
a.cc:6:17: error: 'strlen' was not declared in this scope
    6 |         int n = strlen(a + 1);
      |                 ^~~~~~
a.cc:1:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | #incnlude <bits/stdc++.h>
a.cc:11:9: error: 'cout' was not declared in this scope
   11 |         cout << a[1] - '0' - pp + (n - 1) * 9;
      |         ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #incnlude <bits/stdc++.h>
Language: C++

#incnlude <bits/stdc++.h>
using namespace std;
int main() {
	char a[110];
	scanf("%s", a + 1);
	int n = strlen(a + 1);
	int pp = 0;
	rep(i, 2, n)
		if(a[i] != '9') 
			pp = 1;
	cout << a[1] - '0' - pp + (n - 1) * 9;
	return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incnlude; did you mean #include?
    1 | #incnlude <bits/stdc++.h>
      |  ^~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:9: error: 'scanf' was not declared in this scope
    5 |         scanf("%s", a + 1);
      |         ^~~~~
a.cc:6:17: error: 'strlen' was not declared in this scope
    6 |         int n = strlen(a + 1);
      |                 ^~~~~~
a.cc:1:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | #incnlude <bits/stdc++.h>
a.cc:8:13: error: 'i' was not declared in this scope
    8 |         rep(i, 2, n)
      |             ^
a.cc:8:9: error: 'rep' was not declared in this scope
    8 |         rep(i, 2, n)
      |         ^~~
a.cc:11:9: error: 'cout' was not declared in this scope
   11 |         cout << a[1] - '0' - pp + (n - 1) * 9;
      |         ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #incnlude <bits/stdc++.h>
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int wa(int num)
{
  int dig = 0;
  int sum = 0;
  while (num)
  {
    if (num / 10 == 0)
    {
      sum += num;
      break;
    }
    dig = num % 10;
    if (dig != 9)
    {
      sum += 9;
      num = num / 10;
      num--;
    }
    else
    {
      sum += 9;
      num = num / 10;
    }
  }
  return sum;
}

int main()
{
  int N;
  int result = 0;
  cin >> N;
  int keta = log10(N);
  if (N / 10 == 0)
  {
    result == N;
    break;
  }
  result = wa(i);

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


Compiler output:
a.cc: In function 'int main()':
a.cc:42:5: error: break statement not within loop or switch
   42 |     break;
      |     ^~~~~
a.cc:44:15: error: 'i' was not declared in this scope
   44 |   result = wa(i);
      |               ^
Language: C++

#include<stdio.h>
#include <inttypes.h>

void main(){
  unsigned long long int input = 0;
  unsigned long long int temp = 0;
  int max = 0;
  int num = 0;
  int f = 0;

  scanf("%"SCNu64,&input);
  temp = input;
  while(temp){
    num++;
    f = temp%10;
    temp /= 10;
  }
  for(int i = 0; i < num - 1;i++){
    max += 9;
  }
  max += f - 1;

  printf("%d\n", max);

}


Compiler output:
a.cc:11:9: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
   11 |   scanf("%"SCNu64,&input);
      |         ^
a.cc:4:1: error: '::main' must return 'int'
    4 | void main(){
      | ^~~~
Language: C++

# coding: utf-8
# Your code here!
N = int(input())

def kazu(x):
    if x == 0:
        return 0,0
    else:
        a = x
        top = 0
        keta = 0
        while(a!=0):
            top = a
            a = a//10
            keta += 1
        return keta,top
#print(N,keta,top)

def digsum(x):
#    print(x)
    xketa, xtop = kazu(x)
 #   print(xketa, xtop)
    if x == 0:
        return 0
    else:
        xdown = x - (10**(xketa-1))*xtop
  #      print(xdown)
        return max((xtop -1) + 9*(xketa-1), xtop + digsum(xdown))
print(digsum(N))

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:2:3: error: invalid preprocessing directive #Your
    2 | # Your code here!
      |   ^~~~
a.cc:17:2: error: invalid preprocessing directive #print
   17 | #print(N,keta,top)
      |  ^~~~~
a.cc:20:6: error: invalid preprocessing directive #print
   20 | #    print(x)
      |      ^~~~~
a.cc:22:6: error: invalid preprocessing directive #print
   22 |  #   print(xketa, xtop)
      |      ^~~~~
a.cc:27:10: error: invalid preprocessing directive #print
   27 |   #      print(xdown)
      |          ^~~~~
a.cc:3:1: error: 'N' does not name a type
    3 | N = int(input())
      | ^