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

#include<iostream>
using namespace std;

int main(void){
	int n, b;
	cin >> n >> b;
	int x =1;
	while(n!=1){
		n/=b;
		x++;
	}
	cout << x << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:12:27: error: expected '}' at end of input
   12 |         cout << x << endl;
      |                           ^
a.cc:4:15: note: to match this '{'
    4 | int main(void){
      |               ^
Language: Java

public class Main {
	public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    }
    
	//フィールド
    Scanner sc;
    int N;
    int K;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.nextInt();
        this.K = sc.nextInt();
    }
    
    //解答処理
    private int solve() {
        int answer = 0;
        //NをK進数に変換する
        String num = Integer.toString(N, K);
        answer = num.length();
        return answer;
    }
    
    //出力
    public void show(int answer) {
        System.out.println(answer);
    }

}


Compiler output:
Main.java:10: error: cannot find symbol
    Scanner sc;
    ^
  symbol:   class Scanner
  location: class Main
Main.java:15: error: cannot find symbol
    Main(Scanner sc) {
         ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
4 errors
Language: C++

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

int main() {
   N, K, C=0;
  cin >> N >> K;
  while(N>0) {
    N/=K;
    C++;
  }
  cout << C << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:4: error: 'N' was not declared in this scope
    5 |    N, K, C=0;
      |    ^
a.cc:5:7: error: 'K' was not declared in this scope
    5 |    N, K, C=0;
      |       ^
a.cc:5:10: error: 'C' was not declared in this scope
    5 |    N, K, C=0;
      |          ^
Language: Java

import java.util.Scanner;

public class Test002 {
	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();

		digits(N, K);
	}

	public static int digits(int N, int K) {
		int count = 1;

		while (N >= K) {
			N = N / K;
			count++;
		}
		System.out.println(count);
		return 0;
	}
}

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

#include <bits/stdc++.h>
using namespace std;
int main(){
long long N,K;
cin>>N>>K;
long long count=K;
long long answer=1;
if(N<=K){
    cout<<1<<endl;
}
else
{
for(int i=0; i<35; i++){
    answer++;
    if(N<=count*K){
       break; 
    }
    else
    count*=K;
}
cout<<answer<<endl;
}
}
}


Compiler output:
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
long long N,K;
cin>>N>>K;
long long count=K;
long long answer=1;
if(K>=N){
    cout<<1<<endl;
}
else
{
for(int i=0; i<35; i++){
    answer++;
    if(N<=count*K){
       break; 
    }
    else
    count*=K;
}
cout<<answer<<endl;
}
}
}


Compiler output:
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
long long N,K;
cin>>N>>K;
long long count=K;
long long answer=1;
if(K>N){
    cout<<1<<endl;
}
else
{
for(int i=0; i<35; i++){
    answer++;
    if(count*K=>N){
        cout<<answer<<endl;
       break; 
    }
    else
    count*=K;
}
cout<<answer<<endl;
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: expected primary-expression before '>' token
   15 |     if(count*K=>N){
      |                ^
Language: C++

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

int main() {
  long long N;
  int K;
  cin >> N >> K;
  for(int i =0;N == 0;i++{
    N /= K;
    if(N == 0)cout << i <<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: expected ')' before '{' token
    8 |   for(int i =0;N == 0;i++{
      |      ~                   ^
      |                          )
Language: C

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

int main(void){
        double n ,k;
        scanf("%lf %lf",&n ,&k);
        int ans = (int)roud(ceil(log(n)/log(k)));
        if (pow(k,ans)== n) ans++;
        printf("%d\n",ans);
        return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:24: error: implicit declaration of function 'roud'; did you mean 'round'? [-Wimplicit-function-declaration]
    7 |         int ans = (int)roud(ceil(log(n)/log(k)));
      |                        ^~~~
      |                        round
Language: Java

import java.util.Scanner;

class Main {
    public static void main(String[] args) {
      	Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();

        int n = 10;
		int m = K;
		String s = Integer.toString(Integer.parseInt(String.valueOf(N) ,n),m);



        String A = s.length();
        System.out.println(A);
    }
}


Compiler output:
Main.java:15: error: incompatible types: int cannot be converted to String
        String A = s.length();
                           ^
1 error
Language: Java

import java.util.Scanner;
import java.lang.Integer;
import java.lang.String;

class Main {
    public static void main(String[] args) throws NumberFormatException {
      	Scanner sc = new Scanner(System.in);
		var N = sc.nextInt();
        var K = sc.nextInt();
        System.out.println(String.valueOf(Integer.parseInt(N, K)).length());
    }
}


Compiler output:
Main.java:10: error: incompatible types: int cannot be converted to String
        System.out.println(String.valueOf(Integer.parseInt(N, K)).length());
                                                           ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: Java

import java.util.Scanner;
import java.lang.Integer;

class Main {
    public static void main(String[] args) throws NumberFormatException {
      	Scanner sc = new Scanner(System.in);
		var N = sc.nextInt();
        var K = sc.nextInt();
        System.out.println(String.valueOf(Integer.parseInt(String.valueOf(N), String.valueOf(K))).length());
    }
}


Compiler output:
Main.java:9: error: incompatible types: String cannot be converted to int
        System.out.println(String.valueOf(Integer.parseInt(String.valueOf(N), String.valueOf(K))).length());
                                                                                            ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: Java

import java.util.Scanner;
import java.lang.Integer;

class Main {
    public static void main(String[] args) throws NumberFormatException {
      	Scanner sc = new Scanner(System.in);
		var N = sc.nextInt();
        var K = sc.nextInt();
        String n = N;
        String k = K; 
        System.out.println(String.valueOf(Integer.parseInt(n, k)).length());
    }
}


Compiler output:
Main.java:9: error: incompatible types: int cannot be converted to String
        String n = N;
                   ^
Main.java:10: error: incompatible types: int cannot be converted to String
        String k = K; 
                   ^
Main.java:11: error: incompatible types: String cannot be converted to int
        System.out.println(String.valueOf(Integer.parseInt(n, k)).length());
                                                              ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
3 errors
Language: Java

import java.util.Scanner;
import java.lang.Integer;

class Main {
    public static void main(String[] args) throws NumberFormatException {
      	Scanner sc = new Scanner(System.in);
		var N = sc.nextInt();
        var K = sc.nextInt();
        System.out.println(String.valueOf(Integer.parseInt(N, K)).length());
    }
}


Compiler output:
Main.java:9: error: incompatible types: int cannot be converted to String
        System.out.println(String.valueOf(Integer.parseInt(N, K)).length());
                                                           ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: C

#include<stdio.h>
int main(void){
  int N,K,i;
  scanf("%d %d",N,K);
  for(i=0;i++){
    if(N<K){break;}
    else(N=N/K);
  }
  printf("%d",i+1);
  return 0;
}
  


Compiler output:
main.c: In function 'main':
main.c:5:14: error: expected ';' before ')' token
    5 |   for(i=0;i++){
      |              ^
      |              ;
Language: C++

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

int main() {
  int A,B;
  int C = B;
  cin >> A >> B;
  int count = 0;
  for(int i = 0;B < A;i++){
    B *= C;
    count++;
    if(A > B){
      cout << B << endl;
    }
}
 if(B > A){
   cout << 1 << endl;
 }

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

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

 int main() {
 int N, K;
 cin >> N >> K;
 int ans = 0;
 while(N > 0) {
 N /= K; 
 0 ans++;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected ';' before 'ans'
   10 |  0 ans++;
      |   ^~~~
      |   ;
Language: C++

#include <iostream>

int main()
{
  long long N;
  int K; 
  
  std::cin >> N >> K;
  
  int ans = -1;
  int gen = 0;
  for(int i=0; gen<N; i++)
  {
    int degit = 1;
    for(int i=0; j<=i; i++)
    {
      degit *= K;
    }
    gen = degit - 1;
    ans++;
  }
  std::cout << ans << std::endl;
  return 0;
}

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

include <iostream>
int main()
{
    long long N;
     int K;

    std::cin >> N >> K;

    // NをK進法にする 
    int ans = -1;
  int gen_num = 0;
     for(int i=0; gen_num<N; i++)
    {
         int degit = 1;
          for(int j=1; j<=i; j++)
          {
              degit *= K;
          }
         gen_num = degit - 1;
  //      printf("%d\n", gen_num);
         ans++;
      }
  std::cout << ans << std::endl;
  return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A,B;
  cin >> A >> B;
  int C = B;
  int i = 0;
  while(A > C){
   C *= B;
   i++
  }
  
  if(A > B){
   cout << i - 1 << endl;
  }

  if(A - 1 < B){
    cout << 1 << endl;
  }
    
}

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

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

int main()
{
    int n,k;
    cin>>n>>k;

  int x=0;
  
  for(int kei=1;x<n;kei++)
  {
      x = pow(k,kei);
  
  }

  
   cout<<kei<<endl;


}

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

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

int main()
{
    int n,k;
    cin>>n>>k;

 
  int kei=1;
   while(n>x)
   {  
      int x=0;
       x = pow(k,kei);
   
       kei++;   
   }


   cout<<kei<<endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: 'x' was not declared in this scope
   11 |    while(n>x)
      |            ^
Language: C

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

int convert(int x, int n){
    int y=0, i=0, z;
    while(x > 0){
        z = x%n;
        y += z*pow(10, i);
        x = x/n;
        i++;
    }
    return y;
}

int main(void){
    int n,k;
  char s[1000];
  int len;
  scanf("%d%d",&n,&k);
  s = convert(n,k);
  len = strlen(s);
  printf("%d",l);
  return 0;
  
  
}

Compiler output:
main.c: In function 'main':
main.c:21:5: error: assignment to expression with array type
   21 |   s = convert(n,k);
      |     ^
main.c:23:15: error: 'l' undeclared (first use in this function)
   23 |   printf("%d",l);
      |               ^
main.c:23:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

/* ex3_3
  terakura */
 
#include <stdio.h>
 
int main(void){
 
    int n, bace, digits = 0;
 
    scanf("%d %d", &n, &bace);
 
  //nをbaceで割った商が0になるまで繰り返す
    while(n>0){
      n = n/bace;    //nにnをbで割った商を代入
      digits++;    //digitsに１をたす
    }

Compiler output:
main.c: In function 'main':
main.c:16:5: error: expected declaration or statement at end of input
   16 |     }
      |     ^
Language: C

/* ex3_3
  terakura */

#include <stdio.h>

int main(void){

    int n, bace, digits = 0;

    scanf("%d %d", &n, &bace);

  //nをbaceで割った商が0になるまで繰り返す
    while(n>0){
      n = n/bace;    //nをbで割った商を代入
      digits++;    //digitsに１をたす
    }

    printf("%d\n", c);    //桁数を出力

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:18:20: error: 'c' undeclared (first use in this function)
   18 |     printf("%d\n", c);    //桁数を出力
      |                    ^
main.c:18:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C

/* ex3-3
   Sagzar1993  */


#include <stdio.h>

int main(void) {
    //表す整数と基数を定義
    int num, numBase;

    //入力を受け取る
    scanf("%d %d", &num, &numBase);

    int i = 0, quot;

    do{
        quot = num / numBase;
        num = quot;
        i++;
    }while(quot > 1)

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

Compiler output:
main.c: In function 'main':
main.c:20:21: error: expected ';' before 'printf'
   20 |     }while(quot > 1)
      |                     ^
      |                     ;
   21 | 
   22 |     printf("%d\n", i);
      |     ~~~~~~
Language: C++

/*
ex3_3
tomatokan
*/
#include<stdio.h>
 
int main(void){
    int n,k,digits,k_pow_digits;
    scanf("%d",&n);
    scanf("%d",&k);
    digits=1;
    k_pow_digits=k;/*k_pow_digits=k^digits*/
    while(n>=k_pow_digits){/*n>=l ならn>=k^digits*/
        digits++;
        k_pow_digits=k_pow_digits*k;
    }
    printf("%d\n",i);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:19: error: 'i' was not declared in this scope
   17 |     printf("%d\n",i);
      |                   ^
Language: C

/* kadai3_3
   Saikyo_Kazune
*/
#include <stdio.h>
//累乗関数を自前定義
int pow(int num_K,int num_L){
    if(num_L==0){
        return 1;
    }
    else if(num_L%2==1){
        return num_K*pow(num_K,L-1);
    }
    else{
        return pow(num_K,L/2)*pow(num_K,num_L/2);
    }
}
 
int main(void){
   //int型　num_N,num_K,桁数ようにLを宣言
   int num_N,num_K,L=1;
   scanf("%d %d",&num_N,&num_K);
   while(num_N/pow(num_K,L)!=0){
       L++;
   }
   printf("%d\n",L);
 
    return 0;
}

Compiler output:
main.c:6:5: warning: conflicting types for built-in function 'pow'; expected 'double(double,  double)' [-Wbuiltin-declaration-mismatch]
    6 | int pow(int num_K,int num_L){
      |     ^~~
main.c:5:1: note: 'pow' is declared in header '<math.h>'
    4 | #include <stdio.h>
  +++ |+#include <math.h>
    5 | //累乗関数を自前定義
main.c: In function 'pow':
main.c:11:32: error: 'L' undeclared (first use in this function)
   11 |         return num_K*pow(num_K,L-1);
      |                                ^
main.c:11:32: note: each undeclared identifier is reported only once for each function it appears in
Language: C

//ex3_3
//TKC001
 
#include<stdio.h>
#include<math.h>
 
int main(void){
    double exact, base, logkn;
    int digits;
 
    scanf("%lf", &exact);
    scanf("%lf", &base);
 
    logKN = log(exact) / log(base);
 
    digits = logkn;
 
    printf("%d", digits+1);
 
    return 0;
 
}

Compiler output:
main.c: In function 'main':
main.c:14:5: error: 'logKN' undeclared (first use in this function); did you mean 'logkn'?
   14 |     logKN = log(exact) / log(base);
      |     ^~~~~
      |     logkn
main.c:14:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

/* ex3_2
   moka223711 */

#include <stdio.h>

int main(void){
	int num, K, i = 1;
	scanf("%d %d", &N, &K);

	// numがK^i以上のとき、K進法はi桁で表せる
	// numをKで割り続けて何回割れるかをiでカウントする
	while(num >= K){
		num /= K;
		i++;
	}

	printf("%d", i);

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:25: error: 'N' undeclared (first use in this function)
    8 |         scanf("%d %d", &N, &K);
      |                         ^
main.c:8:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main() {
  int n,k;
  cin >> n >> k;
  
  for(int i=0; i<=9; i++){
    if(pow(k,i) <= n && n < pow(k.i+1)){
      cout << i << endl;
      break;
    }
  }
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:35: error: request for member 'i' in 'k', which is of non-class type 'int'
    9 |     if(pow(k,i) <= n && n < pow(k.i+1)){
      |                                   ^
Language: C

include<stdio.h>
int main(void){
    int N,K,L;
    int digit=1;
    scanf("%d %d\n",&N,&K);
    L = K;

    while(K < N){
    K = L*K;
    digit = digit +1;
    }
    printf("%d\n",digit);
    return 0;
}

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

import java.util.Scanner;

class Main{
 public static void main(String args[]){
   Scanner sc = new Scanner(System.in);
   long N = sc.nextLong();
   int K = sc.nextInt();

   for(int i=0;;i++){
    if(K^i>N){
    System.out.println(i);
      break;
    }
   }
 
 }
}


Compiler output:
Main.java:10: error: bad operand types for binary operator '^'
    if(K^i>N){
        ^
  first type:  int
  second type: boolean
1 error
Language: C++

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

int main(){
  int a,b;
  float c=a;
  cin >> a >> b;
  for(int i;i<a;i++){
    if(a=<pow(b,i)){
      cout << i;
      break;
    }
  }
  return 0;
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: expected primary-expression before '<' token
   10 |     if(a=<pow(b,i)){
      |          ^
Language: C

#include <stdio.h>

int main(void) {
  int N, K, ans = 0;
  scanf("%d,%d", &N, &K);
  while (N) {
    N /= K;
    ans++;
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:3: error: 'cout' undeclared (first use in this function)
   10 |   cout << ans << endl;
      |   ^~~~
main.c:10:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:18: error: 'endl' undeclared (first use in this function)
   10 |   cout << ans << endl;
      |                  ^~~~
Language: C++

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

int main() {
  int N, K;
  cin >> N >> K;
  int tmp = 1;
  int res = 1;
  if (K == 10) res++;
  while (tmp < N) {
    tmp *= K
    res++;
  }
  cout << res;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: expected ';' before 'res'
   12 |     tmp *= K
      |             ^
      |             ;
   13 |     res++;
      |     ~~~
Language: C++

#include <iostream>
#include <vector>

int main(void) {
  auto N = 0;
  auto K = 0;
  std::cin >> N >> K;
  std::vector<int> vect;
  while (N != 0) {
    vect.push_back(N % K);
    N = N / K;
  }
  std::cout << vec.size();
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'vec' was not declared in this scope; did you mean 'vect'?
   13 |   std::cout << vec.size();
      |                ^~~
      |                vect
Language: C

#include<stdio.h>

int main(void){
   int  n,k,ans=0;
   scanf("%d%d",&n,&k);
   while(n>=1){
        n=n/k;
        ans++;
   }
   printf("%d\n"ans);
   return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:17: error: expected ')' before 'ans'
   10 |    printf("%d\n"ans);
      |          ~      ^~~
      |                 )
Language: C++

#include<iostream>
#include <numeric>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <bits/stdc++.h> 
using namespace std;
 
#define REP(i, a, b) \
for (int i = int(a); i <= int(b); i++) 
\
 
int main()
{
  int n,k,c=1;
  cin>>n>>k;
  	while(n!=1)
    {
      n=n/k;
      c++;
    }
  cout<<c;
  }
  return 0;
}

Compiler output:
a.cc:24:3: error: expected unqualified-id before 'return'
   24 |   return 0;
      |   ^~~~~~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C

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

int main(void)
{
        int N, K, i, s;

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

        for(i=0;i>0;i++){
                if(pow(K,i)>=N) break;
        }

        printf("%d",i-1):
        return 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:25: error: expected ';' before ':' token
   14 |         printf("%d",i-1):
      |                         ^
      |                         ;
Language: C++

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

int main(){
  int n, k;
  cin >> n >> k;
  int ans = 0
  while(n > 0) {
  n /= k;
  ans++;
}
  cout << ans << endl;
  return 0

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'while'
    9 |   while(n > 0) {
      |   ^~~~~
a.cc:14:11: error: expected ';' before '}' token
   14 |   return 0
      |           ^
      |           ;
   15 | 
   16 | }
      | ~
Language: C++

#include<iostream>
using namespace std;

int main(){
  int n,k;
  cin>>n>>k;
  int ans=0;
  while(n>0){
    n/=k;
    ans=++;
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: expected primary-expression before ';' token
   10 |     ans=++;
      |           ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int n,k;
  cin>>n>>k;
  int ans=0;
  for(n>0){
    n/=k;
    ans=++;
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: expected ';' before ')' token
    8 |   for(n>0){
      |          ^
      |          ;
a.cc:13:1: error: expected primary-expression before '}' token
   13 | }
      | ^
a.cc:12:19: error: expected ')' before '}' token
   12 |   cout<<ans<<endl;
      |                   ^
      |                   )
   13 | }
      | ~                  
a.cc:8:6: note: to match this '('
    8 |   for(n>0){
      |      ^
a.cc:13:1: error: expected primary-expression before '}' token
   13 | }
      | ^
Language: C++

#include<iostream>

int main(){
  int n,k;
  cin>>n>>k;
  int ans=0;
  for(n>0){
    n/=k;
    ans=++;
  }
  cout<<ans<<endl;
}

Compiler output:
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>>n>>k;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:10: error: expected ';' before ')' token
    7 |   for(n>0){
      |          ^
      |          ;
a.cc:11:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |   cout<<ans<<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:11:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |   cout<<ans<<endl;
      |              ^~~~
      |              std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:12:1: error: expected primary-expression before '}' token
   12 | }
      | ^
a.cc:11:19: error: expected ')' before '}' token
   11 |   cout<<ans<<endl;
      |                   ^
      |                   )
   12 | }
      | ~                  
a.cc:7:6: note: to match this '('
    7 |   for(n>0){
      |      ^
a.cc:12:1: error: expected primary-expression before '}' token
   12 | }
      | ^
Language: C++

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

int main(){
  long n,k,c;
  cin >> n,k;
  c=0
  while(n){
  	c++;
    n=n/k;
  }
  cout << c;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: expected ';' before 'while'
    7 |   c=0
      |      ^
      |      ;
    8 |   while(n){
      |   ~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int n, k;
  cin >> n >> k;
  int ans = int(math.log(n, k)) + 1;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'math' was not declared in this scope
    7 |   int ans = int(math.log(n, k)) + 1;
      |                 ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int n, k;
  cin >> n >> k;
  int ans = int(math.log(N, K)) + 1;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'math' was not declared in this scope
    7 |   int ans = int(math.log(N, K)) + 1;
      |                 ^~~~
a.cc:7:26: error: 'N' was not declared in this scope
    7 |   int ans = int(math.log(N, K)) + 1;
      |                          ^
a.cc:7:29: error: 'K' was not declared in this scope
    7 |   int ans = int(math.log(N, K)) + 1;
      |                             ^
Language: C++

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

int main() {
  int N,K;
  cin >>N>>K;
  int a=1;
  
  for(int i=1;;i++){
    if(pow(K,i) <= N){
      a++;
    }
    if(pow(k,i) > N){
      break;
    }
  }
  cout << a << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: 'k' was not declared in this scope
   13 |     if(pow(k,i) > N){
      |            ^
Language: C++

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

int main() {
  int N,K;
  cin >>N>>K;
  int a=1;
  
  for(int i=1;;i++){
    if(pow(K,i) <= N){
      a++
    }
    if(pow(k,i) > N){
      break;
    }
  }
  cout << a << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: expected ';' before '}' token
   11 |       a++
      |          ^
      |          ;
   12 |     }
      |     ~     
a.cc:13:12: error: 'k' was not declared in this scope
   13 |     if(pow(k,i) > N){
      |            ^
Language: C

#include<bits/stdc++.h> 
using namespace std; 
int main()
{ 
    int n,k; 
    scanf("%d %d", &n, &k); 
    int count=1; 
    while(n/k!=0){
         n=n/k;
         count++; 
        } 
      printf("%d\n",count);
     return 0;
}

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

#include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main()
{
int n,k;
  cin>>n>>k;
  int d=log k(n)+1;
  cout<<d<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: cannot resolve overloaded function 'log' based on conversion to type 'int'
    8 |   int d=log k(n)+1;
      |         ^~~
Language: C++

#include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main()
{
int n,k;
  cin>>n>>k;
  int d=logk(n)+1;
  cout<<d<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'logk' was not declared in this scope; did you mean 'logl'?
    8 |   int d=logk(n)+1;
      |         ^~~~
      |         logl
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  	int n,k;
  	cin>>n>>k;
  	int c=0;
  	while(n>0)
    {
      n=n/k;
      c++
    }
  	cout<<c<<endl;
  	return 0;
}

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

#include <stdio.h>
int main(void){
int n,k,r;
int i=0;
scanf("%d %d",&n,&k);
while(n >= 0){
	n % k = r;
	n /= k;
	i++;}
	printf("%d",i);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:15: error: lvalue required as left operand of assignment
    7 |         n % k = r;
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,K;
  int count=0;
  cin>>N>>K;
for(int i=0;i<N/K;i++){
  N=N/K;
  count+=1;
  if(2>N){
  break;
  }
}
cout<<count<<endl;

}
  
  

}

Compiler output:
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

int s[1000];

int main()
{
	int n, k c=1;
	cin >> n >> k;
	while (n >=k)
		c++;
	cout << c;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: expected initializer before 'c'
    8 |         int n, k c=1;
      |                  ^
a.cc:9:21: error: 'k' was not declared in this scope
    9 |         cin >> n >> k;
      |                     ^
a.cc:11:17: error: 'c' was not declared in this scope
   11 |                 c++;
      |                 ^
a.cc:12:17: error: 'c' was not declared in this scope
   12 |         cout << c;
      |                 ^
Language: C++

#include<stdio.h>

int main(){
  int KK,N,K,i;i=0;
  scanf("%d %d",&N,%K);
  KK=1;
  while(true){
    if(N<KK){
      printf("%d\n",i);
      break;
    }
    i++;
    KK=KK*K;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:20: error: expected primary-expression before '%' token
    5 |   scanf("%d %d",&N,%K);
      |                    ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n,k;
  cin>>n>>k;
  int ans=k;
  for(int i=2;i<30;i++){
    ans*=ans;
    if(ans>n)	break;
  }
  cout<<i<<endl;
  return 0;
}

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

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

int main() {
  int n,k;
  cin >> n >> k;
  for(int i=1;i>0;i++){
    if(n/pow(k,i)>0){
      continue;
    }
    else{
      couit << i-1 << endl;
      break;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: 'couit' was not declared in this scope
   12 |       couit << i-1 << endl;
      |       ^~~~~
Language: C++

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

int main() {
  cin >>  n >> k;
  for(int i=1;i>0;i++){
    if(n/pow(k,i)>0){
      continue;
    }
    else{
      couit << i-1 << endl;
      break;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |   cin >>  n >> k;
      |           ^
      |           yn
a.cc:5:16: error: 'k' was not declared in this scope
    5 |   cin >>  n >> k;
      |                ^
a.cc:11:7: error: 'couit' was not declared in this scope
   11 |       couit << i-1 << endl;
      |       ^~~~~
Language: C++

using namespace std;
#include <bits/stdc++.h>
#define rep(i, s) for (int i = 0; i < s; ++i)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define all(v) (v.begin(), v.end())
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define VECV(a,n,m) vector<vector<int>> a(n, vector<int>(m));
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define EPS (1e-7)
#define INF (1e10)
#define PI (acos(-1))
const ll mod = 1000000007;
bool f(string s){
  bool ans=true;
  rep(i,s.size()/2){
    if(s[i]!=s[s.size()/2+i]){
      ans=false;
      break;
    }
  }
  return ans;
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N,K;
  cin>>N>>K;
  int cnt=0;
  int A=K;
  While(A<=N){
    A=A*K;
    cnt=cnt+1;
  }
  cout<<cnt<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:3: error: 'While' was not declared in this scope
   38 |   While(A<=N){
      |   ^~~~~
Language: C++

using namespace std;
#include <bits/stdc++.h>
#define rep(i, s) for (int i = 0; i < s; ++i)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define all(v) (v.begin(), v.end())
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define VECV(a,n,m) vector<vector<int>> a(n, vector<int>(m));
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define EPS (1e-7)
#define INF (1e10)
#define PI (acos(-1))
const ll mod = 1000000007;
bool f(string s){
  bool ans=true;
  rep(i,s.size()/2){
    if(s[i]!=s[s.size()/2+i]){
      ans=false;
      break;
    }
  }
  return ans;
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N,K;
  cin>>N>>K;
  int cnt=0;
  int A=K
  While(A<=N){
    A=A*K;
    cnt=cnt+1;
  }
  cout<<cnt<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:3: error: expected ',' or ';' before 'While'
   38 |   While(A<=N){
      |   ^~~~~
Language: C++

// IlyM

#include <bits/stdc++.h>
#define pb push_back
#define sp " "
#define sl "\n"
#define fi first
#define se second
#define mp make_pair
#define sz(a) ((int)a.size())
#define tra(a,b) for (auto a:b) 
#define fo(a,b,c) for (int a=b;a<=c;a++) 
#define ms(a,b) memset(a,b,sizeof(a)) 
#define all(a) a.begin(),a.end()
#define rev(a) reverse(a.begin(),a.end())
#define bit(i,j) (i&(1<<j))

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef pair<int,ii> iii;

const int N=2e5+5,mod=998244353;
ll n,a,b;
int main()
{
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	cin>>n>>a; while (n) { n/=a; b++;
	}
	cout<<max(1,b);
	return 0;
}


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

#include<stdio.h>
{
long long int a;
int b,c;
c=1;
scanf("%lld %d",&a,&b);
while(a>=b)
  {
   a=a/b;
   c++;
   }
return 0;
}

Compiler output:
main.c:2:1: error: expected identifier or '(' before '{' token
    2 | {
      | ^
Language: C++

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

int main() {
  int n,k,cnt=0;
  cin>>n>>k;
  while(N!=0){
    n/=k;
    cnt++;
  }
  cout<<cnt<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'N' was not declared in this scope
    9 |   while(N!=0){
      |         ^
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
int main(){
  long long n;
  double k;
  cin >>n>>k;
  int total;
  i=0;
  do{n=n/pow(k,i); i++; total+=1;}while(n>pow(k,i))
  cout << total;}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'i' was not declared in this scope
    9 |   i=0;
      |   ^
a.cc:10:52: error: expected ';' before 'cout'
   10 |   do{n=n/pow(k,i); i++; total+=1;}while(n>pow(k,i))
      |                                                    ^
      |                                                    ;
   11 |   cout << total;}
      |   ~~~~
Language: C++

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

int main(){
  int n,k;
  cin >> n >> k;
  int cnt=0;
  for(int i=1;i<100000;i++){
    cnt++;
    if(pow(k,i)>n){
      break;
    }
  }
  cout << cnt << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'pow' was not declared in this scope
   11 |     if(pow(k,i)>n){
      |        ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b;
  int count=0;
  cin>>a>>b;
  while(1){
    a=a/b;
    count++;
  
    if(a<b&&a>=1){
      count=count+1;
    
      break;
    }
    /*  else if(a==0) break;
    
        }*/
  cout<<count<<endl;

  
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,k;
  int ans=1;
  cin >> n >> k;
  while(ans<n){
    ans = ans*k
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: expected ';' before '}' token
    8 |     ans = ans*k
      |                ^
      |                ;
    9 |   }
      |   ~
Language: C++

#include <iostream>
using namespace std;
int main(){
  long long N,K;
  cin>>N>>K;
  int counter=0
  while(N>=K){
    
 N/=K;
   counter++;
  }
  cout<<counter+1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'while'
    7 |   while(N>=K){
      |   ^~~~~
Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define dunk(n) cout << n << endl
#define all(a) (a).begin(),(a).end()

int main() {
    long long n,k;
    cin >> n >> k;
    long long count = 0;
    while(N>0){
        n /= k;
        count++;
    }
    dunk(count);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: 'N' was not declared in this scope
   12 |     while(N>0){
      |           ^
Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define dunk(n) cout << n << endl
#define all(a) (a).begin(),(a).end()
int ruijo(int n,int k){
    if(k == 0) return 1;
    else{
        rep(i,k-1){
            n *= n;
        }
        return n;
    }
}

int main() {
    int n,k;
    cin >> n >> k;
    int count = 0;
    vector<int> amari();
    for(int i = 0;; i++){
        amari[i] = n%k;
        n /= k; 
        count++;
        if(n < k) break;
    }
    dunk(count+1);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:22: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   21 |     vector<int> amari();
      |                      ^~
a.cc:21:22: note: remove parentheses to default-initialize a variable
   21 |     vector<int> amari();
      |                      ^~
      |                      --
a.cc:23:16: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   23 |         amari[i] = n%k;
      |                ^
a.cc:23:18: error: assignment of read-only location '*(amari + ((sizetype)i))'
   23 |         amari[i] = n%k;
      |         ~~~~~~~~~^~~~~
Language: C++

#include<string>
#include<iostream>
#include <algorithm>
#include<vector>
#include<functional>
#include <cstdlib>
#define ll long long
using namespace std;



int main(){
  ll N,K,now=1,keta=0;
  cin>>N>>K;
  while(true){
    now=now*k;
    keta++;
    if(now>=N) break;
  }
  cout<<keta<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: 'k' was not declared in this scope
   16 |     now=now*k;
      |             ^
Language: C++

#include <bits/stdc++.h>
 using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
 int main(){
   int a,b,c,d;
   cin >>a>>b;
   c=1;
   d=1;
   rep(i,50){
    c *=b;
     if(a<=c){
      cout<<d<<endl;
      break;
     }
    d++
   }
     
}

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

#include<stdio.h>
#include<string.h>
void baseconversion(char s[20],int,int);
main()
{   
    char s[20];
    int base1,base2;
    printf("Enter the number and base:");
    scanf("%s%d",s,&base1);
    printf("Enter the base to be converted:");
    scanf("%d",&base2);
    baseconversion(s,base1,base2);
}

void baseconversion(char s[20],int b1,int b2)
{
    int count=0,r,digit,i,n=0,b=1;
    for(i=strlen(s)-1;i>=0;i--)
        {
         if(s[i]>='A'&&s[i]<='Z')
            {
             digit=s[i]-'0'-7;
            }
         else
            {
             digit=s[i]-'0';
            }
        n=digit*b+n;
        b=b*b1;
        }
    while(n!=0)
    {
        r=n%b2;
        digit='0'+r;
        if(digit>'9')
        {
            digit+=7;
        }
         s[count]=digit;
         count++;
         n=n/b2;
    }
for(i=count-1;i>=0;i--)
    {
     printf("%c",s[i]);
    }
 printf("\n");


Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main()
      | ^~~~
main.c: In function 'baseconversion':
main.c:47:2: error: expected declaration or statement at end of input
   47 |  printf("\n");
      |  ^~~~~~
Language: C++

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

int main() {
   int n,k ;
  cin >>n >>k ;
   int ans=1 ;
     int dig=1 ;
  while (n>=ans) {
    ans ＊= k ;
      dig++ ;
  }
  cout << dig << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: expected ';' before '\U0000ff0a'
   10 |     ans ＊= k ;
      |        ^~~
      |        ;
Language: C++

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

int main() {
   int n,k ;
  cin >>n >>k ;
   int ans=1 ;
     int dig=1 ;
  while (N>=ans) {
    ans = ans*k ;
      dig++ ;
  }
  cout << dig << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'N' was not declared in this scope
    9 |   while (N>=ans) {
      |          ^
Language: Java

import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    double A = Math.log(N) / Math.log(K);
    int B=int(A);
    System.out.println( B+1 );  
  }
}


Compiler output:
Main.java:8: error: '.class' expected
    int B=int(A);
             ^
Main.java:8: error: not a statement
    int B=int(A);
              ^
Main.java:8: error: ';' expected
    int B=int(A);
               ^
3 errors
Language: Java

import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    int A = Math.log(N) / Math.log(K);
    System.out.println( A+1 );  
  }
}


Compiler output:
Main.java:7: error: incompatible types: possible lossy conversion from double to int
    int A = Math.log(N) / Math.log(K);
                        ^
1 error
Language: C++

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(){
    int a,b,l;
    char c[100];
    scanf("%d%d",&a,&b);

    itoa(a,c,b);

    l=strlen(c);

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

return 0;
}


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

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(){
    int a,b,l;
    char c[100];
    scanf("%d%d",&a,&b);

    itoa(a,c,b);

    l=strlen(c);

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

return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:5: error: implicit declaration of function 'itoa' [-Wimplicit-function-declaration]
    9 |     itoa(a,c,b);
      |     ^~~~
Language: C

#include<stdio.h>
#include<string.h>
int main(){
    int a,b,l;
    char c[100];
    scanf("%d%d",&a,&b);

    itoa(a,c,b);

    l=strlen(c);

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

return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:5: error: implicit declaration of function 'itoa' [-Wimplicit-function-declaration]
    8 |     itoa(a,c,b);
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,k;
    cin >> n >>k;
    int ans=0;
    for(n>0){
        
        n=n/k;
        ans++;
    }
    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: expected ';' before ')' token
    7 |     for(n>0){
      |            ^
      |            ;
a.cc:13:1: error: expected primary-expression before '}' token
   13 | }
      | ^
a.cc:12:17: error: expected ')' before '}' token
   12 |     cout << ans;
      |                 ^
      |                 )
   13 | }
      | ~                
a.cc:7:8: note: to match this '('
    7 |     for(n>0){
      |        ^
a.cc:13:1: error: expected primary-expression before '}' token
   13 | }
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

const int N=1e6+3;

const double eps=0.000000001;

#define pb push_back
#define all(x) (x).begin(),(x).end()
typedef long long ll;

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

const int inf=1e9,mod=1e9+7;

int n,m,a[N],b[N],k,q,u,v,x,y,tc,c,l,r,ans;

char s[N];

void IO(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("test.txt","r",stdin);
	#endif
}

int main(){
	//IO();
	scanf("%d%d",&n,&k);
	itoa(n,s,k);
	printf("%d\n",strlen(s));
}


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

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

int main(){
        int N,K;
        cin >> N >> K;
        ll ans = 1;
        ll co = pow(K,ans)
        while(N > co) {
                ans++;
        }
        cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: expected ',' or ';' before 'while'
   11 |         while(N > co) {
      |         ^~~~~
Language: C++


#include <iostream>
#include <cmath>

using namespace std;

int main(){
    int N,K;
    cin >> N >> K;
    for(int i = 0;;i++{
        if(N / pow(K,i) == 0){
            cout << i-1 << endl;
            break;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: expected ')' before '{' token
   10 |     for(int i = 0;;i++{
      |        ~              ^
      |                       )