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

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

int main(){
    ins c;
  	cin>>c;
    set <int> st;
    int x = c;
    while (st.count(x)==0)
    {   
        st.insert(x);
            if (x % 2 ==0){
                x =x/2;
            }else{
                x=x*3+1;
            }
    cout<<st.size()+1<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'ins' was not declared in this scope; did you mean 'int'?
    6 |     ins c;
      |     ^~~
      |     int
a.cc:7:14: error: 'c' was not declared in this scope
    7 |         cin>>c;
      |              ^
Language: C++

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

int main(){
    ins c;
    set <int> st;
    int x = c;
    while (st.count(x)==0)
    {   
        st.insert(x);
            if (x % 2 ==0){
                x =x/2;
            }else{
                x=x*3+1;
            }
    cout<<st.size()+1<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'ins' was not declared in this scope; did you mean 'int'?
    6 |     ins c;
      |     ^~~
      |     int
a.cc:8:13: error: 'c' was not declared in this scope
    8 |     int x = c;
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main (){
int a,b=0;
cin>>a;
if(a==4)
flag4++;
if(a==1)
flag1++;
if(a==2)
flag2++;

int flag4 =0,flag1=0,flag2=0;
int c[100];
while(flag1!=2&&flag2!=2&&flag4!=4){
if(a%2==1)
a=a*3+1;
else
a=a/2;

//syori
b++;
if(a==4)
flag4++;
if(a==1)
flag1++;
if(a==2)
flag2++;
}
cout<<b;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'flag4' was not declared in this scope
    7 | flag4++;
      | ^~~~~
a.cc:9:1: error: 'flag1' was not declared in this scope
    9 | flag1++;
      | ^~~~~
a.cc:11:1: error: 'flag2' was not declared in this scope
   11 | flag2++;
      | ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a[1000001];
  int s;
  cin >> s;
  a[0]=s;
  for(int i=1;i<=1000000;i++){
    if(a[i-1]%2==1){
      a[i]=3*a[i]+1;
    }
    else{
      a[i]=a[i-1]/2;
    }
    for(j=0;j<i;j++){
      if(a[i]==a[j]){
        cout << i << endl;
        return 0;
      }
    }
  }
}
      

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

#include<bits/stdc++/h>
using namespace std;
int main(){
  int a[1000001];
  int s;
  cin >> s;
  a[0]=s;
  for(int i=1;i<=1000000;i++){
    if(a[i-1]%2==1){
      a[i]=3*a[i]+1;
    }
    else{
      a[i]=a[i-1]/2;
    }
    for(j=0;j<i;j++){
      if(a[i]==a[j]){
        cout << i << endl;
        return 0;
      }
    }
  }
}
      

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

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

   List<Integer> con = new ArrayList<>();
   while(!con.contains(N))
   {
     con.add(N);
     if(N%2==0) N = N/2;
     else N = 3*N +1;
   }
   
   System.out.println(con.size());
 }
}

Compiler output:
Main.java:7: error: cannot find symbol
   List<Integer> con = new ArrayList<>();
   ^
  symbol:   class List
  location: class Main
Main.java:7: error: cannot find symbol
   List<Integer> con = new ArrayList<>();
                           ^
  symbol:   class ArrayList
  location: class Main
2 errors
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    List<Integer> a=new ArrayList<>();
    a.add(sc.nextInt());
    boolean flg=true;
    int i=0;
    while(flg){
      i++
      if(i%2==0){
        a.add(i/2);
      }else{
        a.add(3*i+1);
      }
      for(int j:a){
        if(j==i){
          flg=false;
        }
      }
    }
    System.out.println(i+1);
  }
}

Compiler output:
Main.java:11: error: ';' expected
      i++
         ^
1 error
Language: Java

import java.util.*;

pulbic class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    List<Integer> a=new ArrayList<>();
    a.add(sc.nextInt());
    boolean flg=true;
    int i=0;
    while(flg){
      i=sc.nextInt();
      if(i%2==0){
        a.add(i/2);
      }else{
        a.add(3*i+1);
      }
      for(int j:a){
        if(j==i){
          flg=false;
        }
      }
    }
    System.out.println(i+1);
  }
}

Compiler output:
Main.java:3: error: class, interface, enum, or record expected
pulbic class Main{
^
1 error
Language: Java

import java.util.*;

pulbic class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    List<Integer> a=new ArrayList<>;
    a.add(sc.nextInt());
    boolean flg=true;
    int i=0;
    while(flg){
      i=sc.nextInt();
      if(i%2==0){
        a.add(i/2);
      }else{
        a.add(3*i+1);
      }
      for(int j:a){
        if(j==i){
          flg=false;
        }
      }
    }
    System.out.println(i+1);
  }
}

Compiler output:
Main.java:3: error: class, interface, enum, or record expected
pulbic class Main{
^
Main.java:6: error: '(' or '[' expected
    List<Integer> a=new ArrayList<>;
                                   ^
2 errors
Language: C++

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

int main() {
    int a,bs,as;
  	bool f;
    cin >> a ;
  	bs = a;
  	f = true;
    for(int i=2;i<10000;i++){
      if(f){
      	as = bs/2;
        f = false
      } else {
        as = bs*3 + 1;
        f = true
      }
      if ( as == bs) break;
    }
    cout << i << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: expected ';' before '}' token
   14 |         f = false
      |                  ^
      |                  ;
   15 |       } else {
      |       ~           
a.cc:17:17: error: expected ';' before '}' token
   17 |         f = true
      |                 ^
      |                 ;
   18 |       }
      |       ~          
a.cc:21:13: error: 'i' was not declared in this scope
   21 |     cout << i << endl;
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define n 1000000
int main(){
  
  long long int s;
  cin>>s;
  long long int prev=s;
  long long int ans=0;
  unordered_set<long long int> s;
  for(long long int i=2;i<n;i++){
    
    if(i%2==0){
      	
      prev=prev/2;
      if(s.find(prev)!=s.end())
      {
        ans=i;
        break;
      }
      else
      {
        s.insert(prev);
      }
    }
    else{
      
       prev=(3*prev)+1 ;
      if(s.find(prev)!=s.end())
      {
        ans=i;
        break;
      }
      else
      {
        s.insert(prev);
      }
      
      
      
    }
    
  }
  cout<<ans;
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:32: error: conflicting declaration 'std::unordered_set<long long int> s'
   10 |   unordered_set<long long int> s;
      |                                ^
a.cc:6:17: note: previous declaration as 'long long int s'
    6 |   long long int s;
      |                 ^
a.cc:16:12: error: request for member 'find' in 's', which is of non-class type 'long long int'
   16 |       if(s.find(prev)!=s.end())
      |            ^~~~
a.cc:16:26: error: request for member 'end' in 's', which is of non-class type 'long long int'
   16 |       if(s.find(prev)!=s.end())
      |                          ^~~
a.cc:23:11: error: request for member 'insert' in 's', which is of non-class type 'long long int'
   23 |         s.insert(prev);
      |           ^~~~~~
a.cc:29:12: error: request for member 'find' in 's', which is of non-class type 'long long int'
   29 |       if(s.find(prev)!=s.end())
      |            ^~~~
a.cc:29:26: error: request for member 'end' in 's', which is of non-class type 'long long int'
   29 |       if(s.find(prev)!=s.end())
      |                          ^~~
a.cc:36:11: error: request for member 'insert' in 's', which is of non-class type 'long long int'
   36 |         s.insert(prev);
      |           ^~~~~~
Language: C++

#include <bits/stdc++.h>
​
using namespace std;
​
int main()
{
    int a0;
    cin>>a0;
​
    int min = a0;
    int a = a0;
    int an = a0;
    vector<int> stocks;
    stocks.push_back(a0);
    int index = 1;
​
    while (true)
    {
        index++;
        if (index % 2 == 0)
        {
            an = a / 2;
        }
        else
        {
            an = 3 * (index) + 1;
        }
      
        for (int i = 0; i < stocks.size(); i++)
        {
            if (an == stocks[i])
            {
                cout << index << endl;
                return 0;
            }
        }
      	a=an;
        stocks.push_back(an);
    }
}

Compiler output:
a.cc:2:1: error: '\U0000200b' does not name a type
    2 | ​
      |  
a.cc:4:1: error: '\U0000200b' does not name a type
    4 | ​
      |
Language: C++

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

int int_len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}

int int_sum(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}






int gcd(int a,int b)
{
 
  int r, tmp;
 
  
 
  /* 自然数 a > b を確認・入替 */
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }
 
  /* ユークリッドの互除法 */
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
 
 
 
  return b;
}







int fac(int n){
  int m=1;
  while(n>=1) m*=n,n--;
  return m;
}

int vec_sum(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}
///////////////////////////
int main() {
  int n,cnt=0;
  cin>>n;
  vector<int> v;
  v.push_back(n);
  while(n!=1){
    if(n%2==0){
      v/=2;
      v.push_back(n);
    }else{
      v*=3;
      v++;
      v.push_back(n);
    }
  }
  v.push_back(1);
  
  
  for(int i=0;i<v.size();i++){
    for(int j=i+1;j<v.size();j++){
      if(i==j){
        cout<<i+1<<endl;
        return 0;
      }
    }
  }
  
  
  
}
///////////////////////////

Compiler output:
a.cc: In function 'int main()':
a.cc:76:8: error: no match for 'operator/=' (operand types are 'std::vector<int>' and 'int')
   76 |       v/=2;
      |       ~^~~
a.cc:79:8: error: no match for 'operator*=' (operand types are 'std::vector<int>' and 'int')
   79 |       v*=3;
      |       ~^~~
a.cc:80:8: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   80 |       v++;
      |       ~^~
Language: C++

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

int main(){
   int a;
  cin >> a;
  int d[0] = a;
  for(int i =1;i<1000000;i++){
  for(int i=1;i<1000000 ;i++){
   int d[i] =0;
    if(d[i-1]%2 == 0){
      d[i] = d[i-1]/2;
    }
    if(d[i]%2 == 1){
      d[i] = 3*d[i-1]+1;
    }
    
    if(d[j] == d[i]){
      cout << i << endl;
      
      return 0;
  }
    
  }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: array must be initialized with a brace-enclosed initializer
    9 |   int d[0] = a;
      |              ^
a.cc:12:14: error: array must be initialized with a brace-enclosed initializer
   12 |    int d[i] =0;
      |              ^
a.cc:20:10: error: 'j' was not declared in this scope
   20 |     if(d[j] == d[i]){
      |          ^
Language: C++

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

int main(){
   int a;
  cin >> a;
  int d[0] = a,
  for(int i =1;i<1000000;i++){
  for(int i=1;i<1000000 ;i++){
   int d[i] =0;
    if(d[i-1]%2 == 0){
      d[i] = d[i-1]/2;
    }
    if(d[i]%2 == 1){
      d[i] = 3*d[i-1]+1;
    }
    
    if(d[j] == d[i]){
      cout << i << endl;
      
      return 0;
  }
    
  }
  }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: array must be initialized with a brace-enclosed initializer
    9 |   int d[0] = a,
      |              ^
a.cc:10:3: error: expected unqualified-id before 'for'
   10 |   for(int i =1;i<1000000;i++){
      |   ^~~
a.cc:10:16: error: 'i' was not declared in this scope
   10 |   for(int i =1;i<1000000;i++){
      |                ^
a.cc:27:4: error: expected '}' at end of input
   27 |   }
      |    ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C

#include<stdio.h>
#define f(x) (x)%2?3*(x)+1:(x)/2
int main(void)
{
  long long cnt=0,a[1000000]={},ans=0;
  int judge=1;
  scanf("%lld",&a[ans]);
  while(judge){
    ans++;
    a[ans]=f(a[ans-1]);
    for(int i=0;i<ans;i++){
      if(a[ans]==ans[i]){
        judge=0;
        break;
      }
    }
  }
  printf("%lld",ans);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:21: error: subscripted value is neither array nor pointer nor vector
   12 |       if(a[ans]==ans[i]){
      |                     ^
Language: C

#include<stdio.h>
#define f(x) (x)%2?3*(x)+1:(x)/2
int main(void)
{
  long long cnt=0,a[1000000]={},ans=0;
  int judge=1;
  scanf("%lld",&a[ans]);
  while(judge){
    ans++;
    a[ans]=f(a[ans-1]);
    for(int i=0;i<ans;i++){
      if(a[ans]==ans[i]){
        judge=0;
        break;
      }
    }
  }
  printf("lld",ans);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:21: error: subscripted value is neither array nor pointer nor vector
   12 |       if(a[ans]==ans[i]){
      |                     ^
Language: C

#include<stdio.h>
#define f(x) (x)%2?3*(x)+1:(n)/2
int main(void)
{
  long long cnt=0,a[1000000]={},ans=0;
  int judge=1;
  scanf("%lld",&a[ans]);
  while(judge){
    ans++;
    a[ans]=f(a[ans-1]);
    for(int i=0;i<ans;i++){
      if(a[ans]==ans[i]){
        judge=0;
        break;
      }
    }
  }
  printf("lld",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:2:29: error: 'n' undeclared (first use in this function)
    2 | #define f(x) (x)%2?3*(x)+1:(n)/2
      |                             ^
main.c:10:12: note: in expansion of macro 'f'
   10 |     a[ans]=f(a[ans-1]);
      |            ^
main.c:2:29: note: each undeclared identifier is reported only once for each function it appears in
    2 | #define f(x) (x)%2?3*(x)+1:(n)/2
      |                             ^
main.c:10:12: note: in expansion of macro 'f'
   10 |     a[ans]=f(a[ans-1]);
      |            ^
main.c:12:21: error: subscripted value is neither array nor pointer nor vector
   12 |       if(a[ans]==ans[i]){
      |                     ^
Language: C

#include<stdio.h>
#define f(x) (x)%2?3*n+1:n/2
int main(void)
{
  long long cnt=0,a[1000000]=0,ans=0;
  int judge=1;
  scanf("%d",&a[ans]);
  while(judge){
    ans++;
    a[ans]=f(a[ans-1]);
    for(int i=0;i<ans;i++){
      if(a[ans]==ans[i]){
        judge=0;
        break;
      }
    }
  }
  printf("lld",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:30: error: invalid initializer
    5 |   long long cnt=0,a[1000000]=0,ans=0;
      |                              ^
main.c:2:22: error: 'n' undeclared (first use in this function)
    2 | #define f(x) (x)%2?3*n+1:n/2
      |                      ^
main.c:10:12: note: in expansion of macro 'f'
   10 |     a[ans]=f(a[ans-1]);
      |            ^
main.c:2:22: note: each undeclared identifier is reported only once for each function it appears in
    2 | #define f(x) (x)%2?3*n+1:n/2
      |                      ^
main.c:10:12: note: in expansion of macro 'f'
   10 |     a[ans]=f(a[ans-1]);
      |            ^
main.c:12:21: error: subscripted value is neither array nor pointer nor vector
   12 |       if(a[ans]==ans[i]){
      |                     ^
Language: C++

s = gets.to_i

list = []
list[s] = 1

(2..1000000).each do |i|
  if s.even?
    s /= 2
  else
    s = 3 * s + 1
  end

  if list[s]
    puts i
    break
  else
    list[s] = 1
  end
end

Compiler output:
a.cc:6:2: error: too many decimal points in number
    6 | (2..1000000).each do |i|
      |  ^~~~~~~~~~
a.cc:1:1: error: 's' does not name a type
    1 | s = gets.to_i
      | ^
Language: C++

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

int F(int n){
  if(n % 2){
    return n / 2;
  }
  else{
    return n * 3 + 1;
  }
}
 
int main(){
  int s;
  cin >> s;
  vector<int> vct;
  vct.push_back(s);
  int i = 1;
  while(true){
    vct.push_back(F(vct[i - 1]));
    for(int checkI = 0; checkI < i; ++checkI){
      if(vct[checkI] == vct[i]){
        break;
      }
    }
    ++i;
  }
  cout i + 1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:7: error: expected ';' before 'i'
   29 |   cout i + 1 << endl;
      |       ^~
      |       ;
Language: Java

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

int main() {

  int s;
  cin >> s;

  vector<int> array(1001000);

  bool valid = true;

  int count = 2;

  array[s]++;

  while (valid) {

    if (s % 2 == 0) {
      s = s / 2;
    } else {
      s = 3 * s + 1;
    }

    if (array[s] != 0) {
      valid = false;
    } else {
      array[s]++;
      count++;
    }

  }

  cout << count << endl;

}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:7: error: not a statement
  cin >> s;
      ^
Main.java:34: error: not a statement
  cout << count << endl;
                ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:9: error: ';' expected
  vector<int> array(1001000);
                   ^
6 errors
Language: C++

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

int main() {
  int s;
  scanf("%d", &n);

  int ans = 1;
  while (1) {
    if (s == 4 || s == 2 || s == 1) break;
    
    if (s % 2 == 0) {
      s /= 2;
    } else {
      s = 3 * s + 1;
    }
    ans++;
  }

  printf("%d", ans + 3);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: 'n' was not declared in this scope
    6 |   scanf("%d", &n);
      |                ^
Language: C++

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

int main()
{
  long long ans=0;
  vector<int> a(1000000);
  cin >> a.at(0);
  for(longlong i=0; i<1000000; i++){
    if(a.at(i-1)%2==0) a.at(i)=a.at(i-1)/2;
    else a.at(i)=a.at(i-1)*3+1;
    for(long long j=0; j<i; j++){
      if(a.at(j)==a.at(i)){
        ans=i+1;
        break;
      }
    }
    if(ans!=0) break;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'longlong' was not declared in this scope
    9 |   for(longlong i=0; i<1000000; i++){
      |       ^~~~~~~~
a.cc:9:21: error: 'i' was not declared in this scope
    9 |   for(longlong i=0; i<1000000; i++){
      |                     ^
Language: Java

/*
 * コラッツの問題
 * コラッツ数列に初期値を入れると値が1になるという予想
 */
import java.util.ArrayList;
import java.util.Scanner;

public class CollatzProblem{
	public static void main(String[] args) {
		//変数定義
		int s;
		ArrayList<Integer> callatzList = new ArrayList<Integer>();

		Scanner sc = new Scanner(System.in);
		s = sc.nextInt();
		callatzList.add(s);

		int CollatzFunc(int s) {
			if(s % 2 == 0) {
				return s/2;
			}else {
				return s*3+1;
			}
		}//end func

		int Judge(int s) {
			if(callatzList.contains(s)) {
				return null;
			}else {
				return 1;
			}
		}//end func

		while(Judge(s)) {
			s = CollatzFunc(s);
			callatzList.add(s);
		}

		System.out.println(callatzList.get(collatzList.indexOf(s)));



	}
}

Compiler output:
Main.java:18: error: ';' expected
		int CollatzFunc(int s) {
		               ^
Main.java:18: error: ';' expected
		int CollatzFunc(int s) {
		                     ^
Main.java:26: error: ';' expected
		int Judge(int s) {
		         ^
Main.java:26: error: ';' expected
		int Judge(int s) {
		               ^
4 errors
Language: C++

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

int main() {
    int s;
    cin>>s;
    int* a = {};
    a=(int*)malloc(1000000);
    if(!a) return;
    a[0]=s;
    int tmp;
    int cnt=0;
    int i=0;
    while(cnt!=2) {
        if(a[i]%2==0) a[i+1]=a[i]/2;
        else if(a[i]%2!=0) a[i+1]=3*a[i]+1;

        if(a[i]==4) {
            cnt++;
        }
        if(cnt==2) {
            cout<<i+1<<endl;
            break;
        }
        i++;
    }
    free(a);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: return-statement with no value, in function returning 'int' [-fpermissive]
    9 |     if(!a) return;
      |            ^~~~~~
Language: C++

#include <iostream>

int f(int i)
{
    return (i%2==0) ? (n / 2) : (3 * n + 1);
}

int main()
{
    int s;
    std::cin >> s;

    int ai_1 = s;
    int i;
    for (i = 2; i < 1000000; i++) {
        int ai = f(ai_1);
        if (ai == ai_1) break;
        ai_1 = ai;
    }

    std::cout << (i-1) << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int f(int)':
a.cc:5:24: error: 'n' was not declared in this scope
    5 |     return (i%2==0) ? (n / 2) : (3 * n + 1);
      |                        ^
Language: C++

#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main()
{
	string s;
	cin >> s;
	int f = 753;
	int ans = 999;
	for(int i = 0; i <= s.size(); i++){
		string sans = s.at(i) + s.at(i+1) + s.at(i+2);
		int runrun = stoi(sans);
		ans = min(ans, abs(runrun-f));
	}
	cout << ans << endl;
}	


Compiler output:
a.cc: In function 'int main()':
a.cc:14:51: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   14 |                 string sans = s.at(i) + s.at(i+1) + s.at(i+2);
      |                               ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
Language: Java

import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        List<Integer> a = new ArrayList<>();
        while(false){
            if(a.contains(s))
            break;
            a.add(s);
            s = s%2 == 0 ? s/2 : s*3+1;
        }
        System.out.println(a.size()+1);
    }
}

Compiler output:
Main.java:8: error: unreachable statement
        while(false){
                    ^
1 error
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		List<Integer> list = new ArrayList<>();
		while(true) {
			if(list.contains(num)) break;
			list.add(num);
			num = num % 2 == 0 ? num/2 : num*3 + 1;
		}
		System.out.println(list.size()+1);
	}


Compiler output:
Main.java:14: error: reached end of file while parsing
	}
	 ^
1 error
Language: Java

/*
	submission # - User: herp_sy
	https://atcoder.jp/contests/
*/

import java.util.*;
import java.util.Collections; // sorting use
import java.io.*;
import static java.lang.System.*;

public class Main{
	public static void main(String[] args){
		ArrsyList<Integer> clz = new ArrayList<Integer>(203);
		Scanner sc = new Scanner(System.in);
		clz.add(sc.nextInt());
		for (int i = 1; i <= 200; ++i){
			if(clz.size() >= 3 && clz.get(i - 3) == clz.get(i)){
				out.println(i);
				break;
			}
		}
	}
}


Compiler output:
Main.java:13: error: cannot find symbol
		ArrsyList<Integer> clz = new ArrayList<Integer>(203);
		^
  symbol:   class ArrsyList
  location: class Main
1 error
Language: C++

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

int main() {
  int a[1000000];
  cin >> a[0];
  int s;
  for(int i = 0; i < 1000000; ++i){
    if(a[i] % 2 == 0)
      a[i+1] = a[i] / 2;
    else
      a[i+1] = 3*a[i] + 1;
    bool b = 0;
    for(int j = 0; j < i; ++j){
      if(a[j] == a[i+1]){
        s = i + 1;
        break;
      }
    }
    if(b)
      break;
  }
  cout << s << endl;
  }
  
}


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

#include<bits/stdc++.h>                                                                                               
 
using namespace std;
 
#define int long long
using pii = pair<int,int>;
constexpr int INF  = 0x3f3f3f3f;
constexpr int LINF = 0x3f3f3f3f3f3f3f3fLL;
 
int a[100000050];
int main()
{
    int s;
    cin >> s;
    int cnt = 1;
    while(true)
    {
        cnt++;
        a[s] = 1;
        if(s % 2 == 1) 
            s = s * 3 + 1;
        else
            s = s/2;
        
        if(a[s] == 1)
        { 
            cout << cnt << '\n';
            break;
        }
    }   
    return 0;
}

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

#include<iostream>

int main(){
 	int n, ans=0;
  	cin >> n;
 	while(n!=2 && n!= 4 &&  n!=1){
     	ans++;
		if(n%2==1){
          	n*=3;n++;
        }
  		else{
          	n/=2;
        }
    }
  	cout << ans + 3;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |         cin >> n;
      |         ^~~
      |         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:15:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |         cout << ans + 3;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++



int coll[1000000];

int num = 0;




int collatz(int i){
    
       num = num+1;
    
        int n = 0;
    
        if (i%2 == 0){
        
           n = i/2;
        
        }else{
            
           n = 3*i+1;
        
        }
   
   
    
    int a = sizeof(coll);
  
//    
    for(int j = 0; j < 1000000; ++j) {
//        
//
//        
        if (coll[j] == n){
////            
////            
             return num+1;
            
            
       }
        
        
   }
    
    
    
    
    coll[num] = n;
    
      //cout << coll[num] << endl;
    
    return collatz(n);
}

int main(int argc, const char * argv[]) {
    
    
    int t = collatz(54);
    
    cout << t << endl;
    
//      int u = dsp(0, 0);
//    
//     cout <<  u << endl;
//    
//    
//    // 整数の入力
//    int a;
//    cin >> a;
//    // スペース区切りの整数の入力
//    
//    int max = 0;
//    
//    
//    for (int i=1; i<a+1; i++) {
//        
//        
//        if (max == 0 || max < i*(a-i)) {
//            
//            max = i*(a-i);
//            
//        }
//        
//        
//        
//    }
//    
//    
//    cout <<  max << endl;
    // スペース区切りの整数の入力
//    int b,c;
//    cin >> b >> c;
//    
//    // 出力
//    cout << (b*c)/2  << endl;
    
    
    
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:61:5: error: 'cout' was not declared in this scope
   61 |     cout << t << endl;
      |     ^~~~
a.cc:61:18: error: 'endl' was not declared in this scope
   61 |     cout << t << endl;
      |                  ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int main(){
  int a;
  cin>>a;
  bool f=true;
  int v[1000000];
  for(int i=0;i<1000000;i++){
  if(a%2==0)a/=2;
  else a=3*a+1;
  v.push_back(a);  
}
  for(int i=0;i<1000000;i++){
    for(int j=i+1;j<1000000;j++){
      if(v[i]==v[j])cout<<j+1<<endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: request for member 'push_back' in 'v', which is of non-class type 'int [1000000]'
   20 |   v.push_back(a);
      |     ^~~~~~~~~
Language: C++

#include<bits/stdc++.h>
int main(void){
std::vector<int> an(30);
  int s,k,i=1;
  std::cin>> s;
  an.at(0)=s;
  while(1){
  if(an.at(i-1)%2==0){an.at(i)=i/2;}
    else{an.at(i)=3*i+1;}
    for(k=0;k<i;k++){
      if(an.at(i)==an.at(k)) break;
    }
    
    i++
     if(i>31) break;
}
   
  std::cout<< k <<std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: expected ';' before 'if'
   14 |     i++
      |        ^
      |        ;
   15 |      if(i>31) break;
      |      ~~
Language: C++

#include<bits/stdc++.h>
int main(void){
std::vector<int> an(1000000);
  int s,k,i=1;
  std::cin>> s;
  an.at(0)=s;
  while(1){
  if(an.at(i-1)%2==0){an.at(i)=i/2;}
    else{an.at(i)=3*i+1}
    for(k=0;k<i;k++){
      if(an.at(i)==an.at(k)) break;
    }
    i++;
  }
  std:cout<< k <<std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: expected ';' before '}' token
    9 |     else{an.at(i)=3*i+1}
      |                        ^
      |                        ;
a.cc:15:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |   std:cout<< k <<std::endl;
      |       ^~~~
      |       std::cout
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:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C

/*
	submission # - User: herp_sy
	https://atcoder.jp/contests/
*/

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

#define _CRT_SECURE_NO_WARNINGS
#define TLong long long
#define TBMod 1000000007

int main(int argc, char const *argv[])
{
	int cir[503];

	scanf("%d",&cir[1]);
	for (int i = 2; i < 500; ++i)	cir[i] = collatzProblem(cir[i - 1]);
	for (int i = 1; i < 500; ++i)
	{
		for (int j = i + 1; j < 500; ++j)
		{
			if(cir[i] == cir[j]){
				printf("%d\n",j);
				return 0;
			}
		}
	}
}


Compiler output:
main.c: In function 'main':
main.c:21:50: error: implicit declaration of function 'collatzProblem' [-Wimplicit-function-declaration]
   21 |         for (int i = 2; i < 500; ++i)   cir[i] = collatzProblem(cir[i - 1]);
      |                                                  ^~~~~~~~~~~~~~
Language: C++

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

int main() {
  int s;
  cin >> s;
  
  int dig = 1000000
  
  map<int,int> mp;
  for (int i=1; i<=dig; i++) mp[i] = 0;
  mp[s] = 1;
  
  for (int i=0; i<dig; i++){
    if (s%2 == 0){
      s = s/2;
      mp[s]++;
    }
    else {
      s = 3*s + 1;
      mp[s]++;
    }
    
    if (mp[s] == 2) {
      cout << i+1 << endl;
      break;
    }
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected ',' or ';' before 'map'
   10 |   map<int,int> mp;
      |   ^~~
a.cc:11:30: error: 'mp' was not declared in this scope
   11 |   for (int i=1; i<=dig; i++) mp[i] = 0;
      |                              ^~
a.cc:12:3: error: 'mp' was not declared in this scope
   12 |   mp[s] = 1;
      |   ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int arr[100000];

int main(){

	int n ;cin >> n;
	for(int i = 2; i <= 1e6; i++){
		// 8  >> 4 2 1 4
		if(n % 2 == 0){
			arr[i] = n / 2;
			n = n/2;
			if(arr[i] == 1){
					cout << i + 1;
					break;
				}
		}

		else{
			arr[i] = 3 * n + 1;
			n = 3 * n + 1;
		}
	}

	return 0;
}


	return 0;
}


Compiler output:
a.cc:29:9: error: expected unqualified-id before 'return'
   29 |         return 0;
      |         ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int findIndex(vector<int> vec, int value)
{
    vector<int>::iterator iter = find(vec.begin(), vec.end(), value);
    size_t index = distance(vec.begin(), iter);
    if(index == vec.size())
    {
        return -1;
    }
    return index;
}


int main()
{
    int s;
    int a[1000000];
    cin >> s;

    a[0] = s;
    for (int i = 1; i < 1000001; i++)
    {
        if (a[i-1] % 2 == 0)
        {
            a[i] = a[i-1] / 2;
        }
        else
        {
            a[i] = 3 * a[i-1] + 1;
        }  
    }

    vector<int> v;
    v.push_back(s);
    int ans = 0;
    for (int i = 1; i < 1000001; i++)
    {
        if (findIndex(v, a[i]) > 0)
        {
            ans = i + 1;
            break;
        }
        
        v.push_back(a[i]);
    }

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

Compiler output:
a.cc: In function 'int findIndex(std::vector<int>, int)':
a.cc:8:38: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
    8 |     vector<int>::iterator iter = find(vec.begin(), vec.end(), value);
      |                                  ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:8:38: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
    8 |     vector<int>::iterator iter = find(vec.begin(), vec.end(), value);
      |                                  ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main(void){
  int s;
  cin >> s;
  
  int a;
  map<int, int> mp;
  
  
  int cnt=1;
  while(1){
    if(map[s] ==1){
      break;
    }
    map[s]++;
    if(s%2 == 0) s = s/2;
    else s = 3*s+1;
    cnt++;
  }
  cout << cnt << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: expected unqualified-id before '[' token
   14 |     if(map[s] ==1){
      |           ^
a.cc:17:11: error: expected initializer before '++' token
   17 |     map[s]++;
      |           ^~
a.cc:17:11: error: expected ';' before '++' token
Language: C++

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

int main(void){
  int s;
  cin >> s;
  
  int a;
  map<int> mp;
  
  
  int cnt=1;
  while(1){
    if(map[s] ==1){
      break;
    }
    map[s]++;
    if(s%2 == 0) s = s/2;
    else s = 3*s+1;
    cnt++;
  }
  cout << cnt << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: wrong number of template arguments (1, should be at least 2)
    9 |   map<int> mp;
      |          ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:14:11: error: expected unqualified-id before '[' token
   14 |     if(map[s] ==1){
      |           ^
a.cc:17:11: error: expected initializer before '++' token
   17 |     map[s]++;
      |           ^~
a.cc:17:11: error: expected ';' before '++' token
Language: C++

#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <queue>
#include <stack>
#include <stdlib.h>
using namespace std;
#define rep(i,n) for (int i = 0; i <n; i++) 

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

using namespace std;

int main(){
    int s;cin>>s;
    int a[1000500];
    a[0]=s;
    for(int i=1;1000001>i;i++)｛
      if(a[i-1]%2==0)a[i]=n/2;
        else a[i]=3*i+1;
      ｝
     for(int i=1000000;i>=0;i--)｛
       if(a[1000000]==a[i])｛cout<<1000000-i;
       return 0;｝
       ｝
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:31: error: '\U0000ff5b' was not declared in this scope
   24 |     for(int i=1;1000001>i;i++)｛
      |                               ^~
a.cc:26:9: error: 'else' without a previous 'if'
   26 |         else a[i]=3*i+1;
      |         ^~~~
a.cc:26:16: error: 'i' was not declared in this scope
   26 |         else a[i]=3*i+1;
      |                ^
a.cc:27:7: error: '\U0000ff5d' was not declared in this scope
   27 |       ｝
      |       ^~
a.cc:30:19: error: expected ';' before '\U0000ff5d'
   30 |        return 0;｝
      |                   ^
      |                   ;
   31 |        ｝
      |        ~~
Language: C++

s=int(input())
a=[s]
temp=len(a)
for i in range(1,1000000):
    if s[i-1]%2:
        a.append(3*s[i-1]+1)
    else:
        a.append(s[i-1]/2)
        
    if temp!=len(a):
        temp=len(a)
    else:
        break
print(a[len(a)-1]

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

#include <iostream>
#include <set>

using namespace std;

int main(){
  int s;
  cin >> s;
  set<int> st;
  int x = s
  int cnt = 1;
  while(st.count(x) == 0){
    st.insert(x);
    if(x % 2 == 0){
      x /= 2;
    }
    else{
      x = x * 3 + 1;
    }
  }

  cout << (st.size() + 1) << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'int'
   11 |   int cnt = 1;
      |   ^~~
Language: C++

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

int main(){
  vector<int> a(11451419);
  int count = 0;
  int s;
  cin >> s;
  while(true){
    if(s%2==0){
      s = s/2;
    }
    else{
      s = 3*s +1;
    }
    count++;
    a.at(count) = s;
    for(int i=0;i<count;i++){
      if(a.at(i) == s){
        cout << count << endl;
        return;
      }
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   21 |         return;
      |         ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    int s;cin>>s;
    vector<int> num;
    int ans=0;
    while(1){
      	num.push_back(s)
        if(s%2==0){
            s = s/2;
        } else{
            s = 3*s+1;
        }
        ans++;
        num.push_back(s);
    
        if(count(num.begin(),num.end(),s) == 2){
            cout << ans+1 << endl;
            return 0;
        }
        
 
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:25: error: expected ';' before 'if'
    9 |         num.push_back(s)
      |                         ^
      |                         ;
   10 |         if(s%2==0){
      |         ~~               
a.cc:12:11: error: 'else' without a previous 'if'
   12 |         } else{
      |           ^~~~
Language: C++

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

int main() {
  int s;
  cin >> s;
  
  vector<int> a = {s};
  
  while (true) {
    int ai;
    
    if (a.back() % 2 == 0) {
      ai = a.back() / 2;
    } else {
      ai = a.back() * 3 + 1;
    }
    
    for (int i = 0; i < a.length(); i++) {
      if (a.at(i) == ai) {
        cout << a.length() << endl;
        return 0;
      }
    }
    
    a.push_back(ai);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:27: error: 'class std::vector<int>' has no member named 'length'
   19 |     for (int i = 0; i < a.length(); i++) {
      |                           ^~~~~~
a.cc:21:19: error: 'class std::vector<int>' has no member named 'length'
   21 |         cout << a.length() << endl;
      |                   ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int s;
  cin >> s;
  vector<int> a;
  a[1]=s;
  bool loop=true;
  for(int i=2;loop;i++){
    if(a[i-1]%2==0)a[i]=a[i-1]/2;
    else a[i]=3*a[i-1]+1;
    for(int j=1;j<i;j++){
      if(a[i]==a[j])loop=false;
    }
  }
  cout << i << endl;
}

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

/**
 *   created: 03 June 2019  00:25:23
**/
#include<bits/stdc++.h>
using namespace std;

typedef vector<int> vi;
typedef pair<int , int> pii;
typedef vector< pair<int , int> > vii;
typedef long long ll;
typedef vector<long long> vl;
typedef pair<long long , long long> pll;
typedef vector< pair<long long , long long> > vll;

#define PB push_back
#define PPB pop_back
#define all(c) c.begin(),c.end()
#define rep(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define rrep(i,a,b) for(int i = (int)(a-1); i>=(int)(b); i--)
#define INFLL 2000000000000000007
#define INF 2000000007
#define MOD 1000000007


#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif


void optimizeIO()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
}

//                                        //AUTHOR: Kaushalesh Shukla

//=========================================================================================================

int main()
{
	optimizeIO();
	int tt=1;
	//cin>>tt;
	while(tt--){
		int n;
		cin>>n;
		st.insert(n);
		int res = 1;
		while(true){
			if(n%2==0)
				n = n/2;
			else
				n = 3*n+1;
			if(st.find(n)!=s.end())
				break;
			st.insert(n);
			res++;
		}
		cout<<res+1;

	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:17: error: 'st' was not declared in this scope; did you mean 'tt'?
   65 |                 st.insert(n);
      |                 ^~
      |                 tt
a.cc:72:40: error: 's' was not declared in this scope
   72 |                         if(st.find(n)!=s.end())
      |                                        ^
Language: C++

#include <iostream>
using namespace std;
int main(){
  int a[100000], i, j;
  cin >> a[0];
  for(i=0;;i++){
    if(a[i]%2==0) a[i+1]=a[i]/2;
    else a[i+1]=3*a[i]+1;
      for(j=0;j<i+1;j++){
	if(a[i+1]==a[j]){ cout << i+1;
	  rerturn 0;
	}
      }
    }
  
}


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

#include <iostream>
using namespace std;
int main(){
  int a[100000];
  cin >> a[0];
  for(i=0;;i++){
    if(a[i]%2==0) a[i+1]=a[i]/2;
    else a[i+1]=3*a[i]+1;
      for(j=0;j<i+1;j++){
	if(a[i+1]==a[j]){ cout << i+1;
	  break;
	}
      }
    }
  return 0;
}


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

#include <iostream>
using namespace std;
int main(){
  int a[100000];
  cin >> a[0];
  for(i=0;;i++){
    if(a[i]%2==0) a[i+1]=a[i]/2;
    else a[i+1]=3*a[i]+1;
      for(j=0;j<i+1;j++){
	if(a[i+1]==a[j]){ cout << i+1;
	  break;
	}
      }
    }
    else
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   for(i=0;;i++){
      |       ^
a.cc:9:11: error: 'j' was not declared in this scope
    9 |       for(j=0;j<i+1;j++){
      |           ^
a.cc:15:5: error: 'else' without a previous 'if'
   15 |     else
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
  int a[100000];
  cin >> a[0]
  for(i=0;;i++){
    if(a[i]%2==0) a[i+1]=a[i]/2;
    else a[i+1]=3*a[i]+1;
      for(j=0;j<i+1;j++){
	if(a[i+1]==a[j]){ cout << i+1;
	  break;
	}
      }
    }
    else
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: expected ';' before 'for'
    5 |   cin >> a[0]
      |              ^
      |              ;
    6 |   for(i=0;;i++){
      |   ~~~         
a.cc:6:12: error: 'i' was not declared in this scope
    6 |   for(i=0;;i++){
      |            ^
a.cc:15:5: error: 'else' without a previous 'if'
   15 |     else
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int odd(int x){
  if(x % 2 == 0){
    return x / 2;
  }
  else{
    return 3 * x + 1
  }
}

int main(){
  int s;
  cin >> s;
  vector<int>a(10000);
  a.at(0) = s;
  int g;
  g = 0;
  
  bool jud = false
  for(int i = 1; i < 10000; i++){
    for(int j = 0; j < i; j++){
    a.at(i) = odd(a.at(i-1));
    if(a.at(i) == a.at(j)){
      g = i;
      jud = true
    }
      if(jud){
        break;
      }
    }
  }
  cout << g << endl;
}

      
  


Compiler output:
a.cc: In function 'int odd(int)':
a.cc:8:21: error: expected ';' before '}' token
    8 |     return 3 * x + 1
      |                     ^
      |                     ;
    9 |   }
      |   ~                  
a.cc: In function 'int main()':
a.cc:21:3: error: expected ',' or ';' before 'for'
   21 |   for(int i = 1; i < 10000; i++){
      |   ^~~
a.cc:21:18: error: 'i' was not declared in this scope
   21 |   for(int i = 1; i < 10000; i++){
      |                  ^
Language: C++

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

int main(){
    int p=0,s;
    int data[1000000];
    cin >>s;

    while (1){
        s=data[p++];
        if(s%2==0){
            s/=2;
        }else{
            s = s*3+1;
        }

        for (int i = 0; i < ans; i++){
            if(data[i]==s){
                cout << i <<endl;
                return 0;
            }
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:29: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |         for (int i = 0; i < ans; i++){
      |                             ^~~
      |                             abs
Language: C

#include<stdio.h>
int fx(int x){
  if(x%2==0)
    return x/2;
  else
    return 3*x+1;
}
int main(void){
  int s,i,j,ori,A[1000];
  scanf("%d",&s);
  A[0]=s;
  for(i=1;i<1000;i++){
    A[i]=fx(A[i-1]);
  }
 for(i=1;i<1000;i++){
   for(j=0;j<i;j++){
     if(A[i]==A[j]){
       printf("%d",i);
       ori=j;
       break;
     }
   }
   if(A[i]==A[ori])
     break;
       }
  return 0;
      }
}

Compiler output:
main.c:28:1: error: expected identifier or '(' before '}' token
   28 | }
      | ^
Language: C

#include<stdio.h>
int fx(int x){
  if(x%2==0)
    return x/2;
  else
    return 3*x+1;
}
int main(void){
  int s,i,j,ori,A[1000];
  scanf("%d",&s);
  A[0]=s;
  for(i=1;i<1000;i++){
    A[i]=fx(A[i-1]);
  }
 for(i=1;i<1000;i++){
   for(j=0;j<i;j++){
     if(A[i]==A[j]){
       printf("%d",i);
       ori=j;
       break;
     }
   }
   if(A{i]==A[ori])
     break;
       }
  return 0;
      }
}

Compiler output:
main.c: In function 'main':
main.c:23:8: error: expected ')' before '{' token
   23 |    if(A{i]==A[ori])
      |      ~ ^
      |        )
main.c: At top level:
main.c:28:1: error: expected identifier or '(' before '}' token
   28 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <algorithm>

using namespace std;

int main(int argc, char* argv[]) {

	long long S;
	int cnt = 1;
	int flg1 = 2;
	int flg2 = 2;
	int flg4 = 2;

	cin >> S;

	do{

		if (S == 4) {
			flg4--;
		}

		if (S == 2) {
			flg2--;
		}

		if (S == 1) {
			flg1--;
		}

		if (S % 2 == 0) {
			S /= 2;
		}
		else {
			S = 3 * S + 1;
		}

		cnt++;

	}(flg1 > 0 && flg2 > 0 && flg4 > 0);

	cout << cnt << endl;

	return 0;

}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:43:10: error: expected 'while' before '(' token
   43 |         }(flg1 > 0 && flg2 > 0 && flg4 > 0);
      |          ^