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

S=input()

i=0
ans,temp=0,0
while(i<len(S)):
    if(S[i]=='A' or S[i]=='T' or S[i]=='G' or S[i]=='C'):
        temp+=1
        ans=max(ans,temp)
    i+=1

print(ans)

Compiler output:
a.cc:1:1: error: 'S' does not name a type
    1 | S=input()
      | ^
Language: Java

import java.util.Scanner;

public class B_ATCoder {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String ar = sc.nextLine();

        int cnt = 0;

        for(int i = 0 ; i < ar.length()-1 ; i++) {

            for(int j = i ; j <= ar.length() ; j++) {
                String str =ar.substring(i, j);
                if(str.matches("([ATCG])+")) {
                    if(cnt<str.length()) {
                        cnt = str.length();
                    }
                }
            }
        }

        System.out.println(cnt);
    }
}

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

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

#define rep(i, n) REP(i, 0, n)
#define REP(i, k, n) for(auto i = k; i != n; i++)
#define rrep(i, n) RREP(i, n, -1)
#define RREP(i, n, k) for(auto i = n; i != k; i--)

#define debug(x) cerr << #x << " " << x << endl
#define print(x) cout << x;
#define println(x) cout << x << endl;
#define spc << " " <<

#define mp make_pair
#define mt make_tuple
#define pf push_front
#define pb push_back
#define ppf pop_front
#define ppb pop_back
#define eb emplace_back
#define np next_permutation

using ll = long long;
using Pii = pair<int, int>;
using Tiii = tuple<int, int, int>;
template<typename T>using V = vector<T>;
template<typename T>using VV = vector<vector<T>>;
using Vi = vector<int>;
using VVi = vector<vector<int>>;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    string S; cin >> S;

    int ans = 0;
    int last_non_atcg_i = -1;

    rep(i, S.length()) {
        switch (S[i]) {
            case 'A':
            case 'T':
            case 'C':
            case 'G':
                continue;
            default:
                ans = max(ans, i - last_non_atcg_i - 1);
                last_non_atcg_i = i;
                break;
        }
    }

    ans = max(ans, i - last_non_atcg_i - 1);
    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:20: error: 'i' was not declared in this scope
   54 |     ans = max(ans, i - last_non_atcg_i - 1);
      |                    ^
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    string str;
    vector<int> vec;
    
    cin >> str;

    for (int i=0; i < (int)str.length(); i++) {
        for (int j=0; j < (int)str.length() - i; j++) {
            if (str[i+j] != 'A' && str[i+j] != 'C' && str[i+j] != 'G' && str[i+j] != 'T') {
                vec.push_back(j);
                break;
            }
        }
    }
    sort(vec.begin(), vec.end());

    cout << vec.back() << endl;
    
   /* for(auto itr = vec.begin(); itr != vec.end(); ++itr) {
        cout << *itr ;
    }*/
    cout << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<int> vec;
      |     ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <algorithm>
  +++ |+#include <vector>
    3 | 
a.cc:9:12: error: expected primary-expression before 'int'
    9 |     vector<int> vec;
      |            ^~~
a.cc:16:17: error: 'vec' was not declared in this scope
   16 |                 vec.push_back(j);
      |                 ^~~
a.cc:21:10: error: 'vec' was not declared in this scope
   21 |     sort(vec.begin(), vec.end());
      |          ^~~
Language: C++


#include <iostream>
using namespace std;
int main(void){
        char buf[255];
        scanf("%s", buf);

        const int len = strlen(buf);
        int count = 0;
        int max_count = 0;
        for (int i = 0 ; i < len ; i++) {
                char c = buf[i];
                switch (c) {
                        case 'A':
                        case 'T':
                        case 'G':
                        case 'C':
                                count++;
                                break;
                        default:
                                if (max_count < count) {
                                        max_count = count;
                                }
                                break;
                }
        }

        std::cout << max_count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: 'strlen' was not declared in this scope
    8 |         const int len = strlen(buf);
      |                         ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <iostream>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	String word = scan.next();
        int longestSubWord = 0;
      	int wordLength = 0;
      	for(int i = 0; i < word.length; i++){
          	String x = word.substring(i,i);
        	if(x = "A" || x = "T" || x = "C" || x = "G"){
            	worLength++;
            } else {
            	if(longestSubWord < wordLength){
                	longestSubWord = wordLength;
                }
            	wordLength = 0;
            }
        }
      	System.out.println(longestSubWord);
    }
}

Compiler output:
Main.java:8: error: cannot find symbol
      	for(int i = 0; i < word.length; i++){
      	                       ^
  symbol:   variable length
  location: variable word of type String
Main.java:10: error: bad operand types for binary operator '||'
        	if(x = "A" || x = "T" || x = "C" || x = "G"){
        	           ^
  first type:  String
  second type: String
Main.java:10: error: bad operand types for binary operator '||'
        	if(x = "A" || x = "T" || x = "C" || x = "G"){
        	                      ^
  first type:  String
  second type: String
Main.java:10: error: bad operand types for binary operator '||'
        	if(x = "A" || x = "T" || x = "C" || x = "G"){
        	                                 ^
  first type:  String
  second type: String
Main.java:10: error: incompatible types: String cannot be converted to boolean
        	if(x = "A" || x = "T" || x = "C" || x = "G"){
        	     ^
Main.java:11: error: cannot find symbol
            	worLength++;
            	^
  symbol:   variable worLength
  location: class Main
6 errors
Language: C++

#include <iostream>
using namespace std;

int main() {
  string s; cin >> s;
  int j = s.length();
  int c = 0; ans = 0;
  for(int i = 0; i < j; i++) {
    switch(s[i]) {
      case 'A':case 'C':case 'G':case 'T':
        ++c;
        break;
      default:
        if(ans < c) {
          ans = c;
          c = 0;
        }
        c = 0;
        break;
  }} 
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
    7 |   int c = 0; ans = 0;
      |              ^~~
      |              abs
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
  string T;
  cin>>T;
  //length()をsize()に変えた。
  int size = T.size();
  int flag[size];
  int count=0;
  int ans=0;
  
  for(int i=0;i++;i<size){
    if(T[i]=='A'||T[i]=='T'||T[i]=='G'||T[i]=='C'){
      flag[i]=1;
      count+=1;
    }else{
      flag[i]=0;
      ans = max(ans, count);
      count=0;
    }
  }
  //最終チェック
  ans = max(ans, count)
  
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:24: error: expected ';' before 'cout'
   24 |   ans = max(ans, count)
      |                        ^
      |                        ;
   25 | 
   26 |   cout<<ans<<endl;
      |   ~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
  string T;
  cin>>T;
  size = T.length();
  int flag[size];
  int count=0;
  int ans=0;
  
  for(int i=0;i++;i<size){
    if(T[i]=='A'||T[i]=='T'||T[i]=='G'||T[i]=='C'){
      flag[i]=1;
      count+=1;
    }else{
      flag[i]=0;
      ans = max(ans, count)
      count=0;
    }
  }
  
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: overloaded function with no contextual type information
    7 |   size = T.length();
      |                   ^
a.cc:8:16: error: cannot resolve overloaded function 'size' based on conversion to type 'long unsigned int'
    8 |   int flag[size];
      |                ^
a.cc:8:7: error: size of array 'flag' has non-integral type '<unresolved overloaded function type>'
    8 |   int flag[size];
      |       ^~~~
a.cc:12:20: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
   12 |   for(int i=0;i++;i<size){
      |                   ~^~~~~
a.cc:18:28: error: expected ';' before 'count'
   18 |       ans = max(ans, count)
      |                            ^
      |                            ;
   19 |       count=0;
      |       ~~~~~
Language: C++

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

int main(){
  string s;
  cin >> s;
  int k=s.size();
  int ans=0;
  for(int i=0;i<k;i++){
    for(int j=i;j<k;j++){
      int count=0;
      if(s.at(j)=='A'||s.at(j)=='C'||s.at(j)=='G'||s.at(j)=='T'){
        count++;
      }
      else{
        break;
      }
    }
    ans=max(ans,count);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: no matching function for call to 'max(int&, <unresolved overloaded function type>)'
   20 |     ans=max(ans,count);
      |         ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'constexpr const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = int]'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:36: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to 'const int&'
  257 |     max(const _Tp& __a, const _Tp& __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,
                 from a.cc:2:
/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:20:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   20 |     ans=max(ans,count);
      |         ~~~^~~~~~~~~~~
Language: Java

import java.util.Scanner;

public class Main{
  static int max;
  static int N;
  static int count;
  static String str;
  static char st;
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    str = sc.next();
    N = str.length;
    max = 0;
    for(int i=0;i<N;i++){
      st = str.charAt(i);
      if(st=='A' || st=='G' || st=='C' || st=='T'){
		count++;
      }
      else if(count>=max){
		max = count;
        count = 0;
      }
    }
    System.out.println(max);
  }
  
}
          
    

Compiler output:
Main.java:12: error: cannot find symbol
    N = str.length;
           ^
  symbol:   variable length
  location: variable str of type String
1 error
Language: C++

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

int main()
{
	string S; cin >> S;
	string T = "ATCG";

	int ans = 0;
	int now = 0;

	for (int i = 0; i < S.size; i++)
	{
		bool isATCG = false;
		for (int j = 0; j < T.size(); j++)
		{
			if (S[i] == T[i]) isATCG = true;
		}

		if (!isATCG) now = 0;
		else
		{
			now++;
			ans = max(now, ans);
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:31: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   12 |         for (int i = 0; i < S.size; i++)
      |                             ~~^~~~
      |                                   ()
Language: C++

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

int main(){
  string s;
  int cnt, ret;
  
  cin >> s;
  for(int i = 0; i < (int)s.size(); i++){
    if(s[i] == 'A' || s[i] == 'G' || s[i] == 'C' || s[i] == 'T'){
      cnt++;
    }else if(ret < cnt){
        ret = cnt;
        cnt = 0;
    }
　}
  printf("%d", ret);
}


Compiler output:
a.cc:17:1: error: extended character 　 is not valid in an identifier
   17 | 　}
      | ^
a.cc: In function 'int main()':
a.cc:17:1: error: '\U00003000' was not declared in this scope
   17 | 　}
      | ^~
Language: C++

#include <string>
using namespace std;

int main(){
  string s;
  int cnt;
  int ret;
  
  cin >> s;
  for(int i = 0; i < (int)s.size(); i++){
    char ch = s[i];
    if(ch == 'A' || ch == 'G' || ch == 'C' || ch == 'T'){
      cnt++;
    }else{
      if(ret < cnt){
        ret = cnt;
        cnt = 0;
      }
    }
　}
  print("%d", ret);
}

Compiler output:
a.cc:20:1: error: extended character 　 is not valid in an identifier
   20 | 　}
      | ^
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope
    9 |   cin >> s;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:20:1: error: '\U00003000' was not declared in this scope
   20 | 　}
      | ^~
a.cc:21:3: error: 'print' was not declared in this scope; did you mean 'printf'?
   21 |   print("%d", ret);
      |   ^~~~~
      |   printf
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define MAXN 20

int dp[MAXN];

bool check(char c){
	if(c == 'A' || c == 'C' || c == 'T' || c == 'G')return true;
	return false;
}


int main(){
	#ifdef EVAL 
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	string s;
	cin >> s;
	int res = 0;
	if(check(s[0])dp[0] = 1;
	for(int i = 0,N = s.size(); i < N; i++){
		if(check(s[i])){
			dp[i] = dp[i - 1] + 1;
			res = max(res,dp[i]);
		}
	}
	cout << res;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:23: error: expected ';' before 'dp'
   23 |         if(check(s[0])dp[0] = 1;
      |                       ^~
      |                       ;
a.cc:24:9: error: expected primary-expression before 'for'
   24 |         for(int i = 0,N = s.size(); i < N; i++){
      |         ^~~
a.cc:23:33: error: expected ')' before 'for'
   23 |         if(check(s[0])dp[0] = 1;
      |           ~                     ^
      |                                 )
   24 |         for(int i = 0,N = s.size(); i < N; i++){
      |         ~~~                      
a.cc:24:37: error: 'i' was not declared in this scope
   24 |         for(int i = 0,N = s.size(); i < N; i++){
      |                                     ^
a.cc:24:41: error: 'N' was not declared in this scope
   24 |         for(int i = 0,N = s.size(); i < N; i++){
      |                                         ^
Language: C++


#include <iostream>
#include <String>
#include <algorithm>

using namespace std;

int main()
{
	string s;

	cin >> s;

	int res;

	for (int i = 0; i < s.length(); i++) {
		for (int j = i; j < s.length(); j++) {
			if (s[j] != 'A' && s[j] != 'C' && s[j] != 'G' && s[j] != 'T') {
				res = max(res, j-i);
				break;
			}
		}
	}
	cout << res << endl;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin >> S;
  int ans = 0;
  int cou = 0;
  string T = "ATGC";
  bool isATGC = false;
  for(int i=0;i<S.size();i++){
    for(int j=0;j<4;j++){
      if(S[i] == T[j]) cou++;
      isATGC = true;
    }
    if(!isATGC || i = S.size() - 1){
      ans = max(ans,cou);
      cou =0;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: lvalue required as left operand of assignment
   15 |     if(!isATGC || i = S.size() - 1){
      |        ~~~~~~~~^~~~
Language: Java



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

public class MAIN {

    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        String AtCoder = sc.next();
        String[] text = AtCoder.split("");
        int count = 0;
        int answer = 0;
        for (int i = 0; i < AtCoder.length(); i++) {
            if (text[i].equals("A") || text[i].equals("C") || text[i].equals("G") || text[i].equals("T")) {
                count++;
            } else {
                if (answer < count) {
                    answer = count;
                }
                count = 0;
            }
        }

        System.out.print(answer);
    }

}


Compiler output:
Main.java:6: error: class MAIN is public, should be declared in a file named MAIN.java
public class MAIN {
       ^
1 error
Language: Java

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package b.atcoder;

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

/**
 *
 * @author cs18097
 */
public class MAIN {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        String AtCoder = sc.next();
        String[] text = AtCoder.split("");
        int count = 0;
        int answer = 0;
        for (int i = 0; i < AtCoder.length(); i++) {
            if (text[i].equals("A") || text[i].equals("C") || text[i].equals("G") || text[i].equals("T")) {
                count++;
            } else {
                if (answer < count) {
                    answer = count;
                }
                count = 0;
            }
        }

        System.out.print(answer);
    }

}


Compiler output:
Main.java:15: error: class MAIN is public, should be declared in a file named MAIN.java
public class MAIN {
       ^
1 error
Language: Java

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package b.atcoder;

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

/**
 *
 * @author cs18097
 */
public class　MAIN {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        String AtCoder = sc.next();
        String[] text = AtCoder.split("");
        int count = 0;
        int answer = 0;
        for (int i = 0; i < AtCoder.length(); i++) {
            if (text[i].equals("A") || text[i].equals("C") || text[i].equals("G") || text[i].equals("T")) {
                count++;
            } else {
                if (answer < count) {
                    answer = count;
                }
                count = 0;
            }
        }

        System.out.print(answer);
    }

}


Compiler output:
Main.java:15: error: illegal character: '\u3000'
public class?MAIN {
            ^
1 error
Language: C


#include<stdio.h>
int main (){
  char s[11]={0};
  int a=0,b=0;
  scanf ("%s",s);
  for (int i=0;i<;){
    if (s[i]=='A' || s[i]=='G' || s[i]=='C' || s[i]=='T'){

a++;

    
    }
    else {
    a=0;
      
    }
    if (b<a) b=a;
}
      

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

Compiler output:
main.c: In function 'main':
main.c:7:18: error: expected expression before ';' token
    7 |   for (int i=0;i<;){
      |                  ^
Language: C++

#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
int Ans(int i,string S) {
    int cnt = 0;
    for(int k=i;S.at(k)=='A','T','C','G';k++){
      cnt++;
    }
    return cnt;
  }

int main() {
  string S;
  cin >> S;
  int N = S.size;
  int output = 0;
  for(int a=0;a<N;a++){
    if(Ans(a,S)>output){
      output = Ans(a,S);
    }
  }
  cout << output <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: cannot convert 'std::__cxx11::basic_string<char>::size' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
   16 |   int N = S.size;
      |             ^~~~
Language: C++

#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
int Ans(int i,string S) {
    int cnt = 0;
    for(int k=i;S.at(k)=='A','T','C','G';k++){
      cnt++;
    }
    return cnt;
  }

int main() {
  string S;
  cin >> S;
  int N = S.size();
  int vector[N];
  
  for(int a=0;a<N;a++){
    vector[a][S] = Ans(a,S);
  }
  
  sort(vector.begin(),vector.end());
  
  cout<<vector[N-1][S]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: no match for 'operator[]' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   20 |     vector[a][S] = Ans(a,S);
      |              ^
a.cc:23:15: error: request for member 'begin' in 'vector', which is of non-class type 'int [N]'
   23 |   sort(vector.begin(),vector.end());
      |               ^~~~~
a.cc:23:30: error: request for member 'end' in 'vector', which is of non-class type 'int [N]'
   23 |   sort(vector.begin(),vector.end());
      |                              ^~~
a.cc:25:20: error: no match for 'operator[]' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   25 |   cout<<vector[N-1][S]<<endl;
      |                    ^
Language: C++

#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
int Ans(int i,string S) {
    int cnt = 0;
    for(int k=i;S.at(k)=='A','T','C','G';k++){
      cnt++;
    }
    return cnt;
  }

int main() {
  string S;
  cin >> S;
  int vector[S.size()];
  
  for(int a=0;a<N;a++){
    vector[a] = Ans(a,S);
  }
  
  sort(vector.begin(),vector.end());
  
  cout<<vector[N-1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'N' was not declared in this scope
   18 |   for(int a=0;a<N;a++){
      |                 ^
a.cc:22:15: error: request for member 'begin' in 'vector', which is of non-class type 'int [<anonymous>]'
   22 |   sort(vector.begin(),vector.end());
      |               ^~~~~
a.cc:22:30: error: request for member 'end' in 'vector', which is of non-class type 'int [<anonymous>]'
   22 |   sort(vector.begin(),vector.end());
      |                              ^~~
a.cc:24:16: error: 'N' was not declared in this scope
   24 |   cout<<vector[N-1]<<endl;
      |                ^
Language: C++

#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
int Ans(int i,string S) {
    int cnt = 0;
    for(int k=i;S.at(k)=='A','T','C','G';k++){
      cnt++;
    }
    return cnt;
  }

int main() {
  string S;
  cin >> S;
  int N = S.size();
  int vector[N];
  
  for(int a=0;a<N;a++){
    vector[a] = Ans(a,S);
  }
  
  sort(vector.begin(),vector.end());
  
  cout<<vector[N-1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:15: error: request for member 'begin' in 'vector', which is of non-class type 'int [N]'
   23 |   sort(vector.begin(),vector.end());
      |               ^~~~~
a.cc:23:30: error: request for member 'end' in 'vector', which is of non-class type 'int [N]'
   23 |   sort(vector.begin(),vector.end());
      |                              ^~~
Language: C++

#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
int Ans(int i,string S) {
    int cnt = 0;
    for(int k=i;S.at(k)=='A','T','C','G';k++){
      cnt++;
    }
    return cnt;
  }

int main() {
  string S;
  cin >> S;
  int N = S.size();
  int vector[N];
  
  for(int a=0;a<N;a++){
    vector[a] = Ans(a,S);
  }
  
  sort(vector.begin(),vector.end());
  
  cout<<vector[N-1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:15: error: request for member 'begin' in 'vector', which is of non-class type 'int [N]'
   22 |   sort(vector.begin(),vector.end());
      |               ^~~~~
a.cc:22:30: error: request for member 'end' in 'vector', which is of non-class type 'int [N]'
   22 |   sort(vector.begin(),vector.end());
      |                              ^~~
Language: C++

#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
int Ans(int i) {
    int cnt = 0;
    for(int k=i;S.at(k)=='A','T','C','G';k++){
      cnt++;
    }
    return cnt;
  }

int main() {
  string S;
  cin >> S;
  int N = S.size();
  int vector[N];
  
  for(int a=0;a<N;a++){
    vector[a] = Ans(a);
  }
  
  sort(S.begin(),S.end());
  
  cout<<S[N-1]<<endl;
}

Compiler output:
a.cc: In function 'int Ans(int)':
a.cc:6:17: error: 'S' was not declared in this scope
    6 |     for(int k=i;S.at(k)=='A','T','C','G';k++){
      |                 ^
Language: C++

#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
int main() {
  string S;
  char A,T,C,G;
  cin >> S;
  int N = S.size();
  int vector[N];
  
  int Ans(int i) {
    int cnt = 0;
    for(int k=i;S.at(k)=='A','T','C','G';k++){
      cnt++;
    }
    return cnt;
  }
  
  for(int a=0;a<N;a++){
    vector[a] = Ans(a);
  }
  
  sort(S.begin(),S.end());
  
  cout<<S[N-1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: a function-definition is not allowed here before '{' token
   11 |   int Ans(int i) {
      |                  ^
a.cc:20:17: error: 'Ans' was not declared in this scope
   20 |     vector[a] = Ans(a);
      |                 ^~~
Language: C++

#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  char A,T,C,G;
  cin >> S;
  int N = S.size();
  int vector[N];
  
  int Ans(int i){
    int cnt = 0;
    for(int k=i;S.at(k)=='A','T','C','G';k++){
      cnt++;
    }
    return cnt;
  }
  
  for(int a=0;a<N;a++){
    vector[a] = Ans(a);
  }
  
  sort(S.begin(),S.end());
  
  cout<<S[N-1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: a function-definition is not allowed here before '{' token
   11 |   int Ans(int i){
      |                 ^
a.cc:20:17: error: 'Ans' was not declared in this scope
   20 |     vector[a] = Ans(a);
      |                 ^~~
Language: C++

#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main()
{
string str;
while(getline(cin,str))
{
vector<int> vec;
int count=0;
for(auto c:str){
if(c=='A'||c=='T'||c=='C'||c=='G')
++count;
else{
vec.push_back(count);
count=0;}
}
cout<<max(vec);
vec.clear();
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:10: error: no matching function for call to 'max(std::vector<int>&)'
   19 | cout<<max(vec);
      |       ~~~^~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    string a;
	while( getline( cin , a ) ){
		int cnt = 0;
		vector<int>ans;
		for( int i = 0 ; i < a.length() ; i++ ){
			if( a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G' ){
				cnt++;
				flag = false;
			} 
			else{
				ans.push_back(cnt);
				cnt = 0;
			} 
		}
		sort( ans.begin() , ans.end() );
		cout<<ans[ans.size() - 1]<<'\n';
	} 
    
    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main()
{
  string S;
  cin >> S;
  int jisuu;
  jisuu = S.size();
  vector <int> count(jisuu);
  vector <int> marker(jisuu);
  vector <int> count2(jisuu);
  int j=0;
  for (int i=0;i<jisuu;i++)
  {
    if (S.at(i) == 'A' || S.at(i) == 'T' || S.at(i) == 'G' || S.at(i) == 'C')
    {
      count[i]=1;
    }
    else
    {
      count[i]=0;
    }
  }
  for (int i=0;i<jisuu;i++)
  {
    if (count[i]==0)
    {
      marker[j]=i;
      j++;
    }
  }
  count2[0]=marker[0];
  for (i=1; i<=jisuu; i++)
  {
    count2[i]=marker[i-1] - marker[i];
  }
  sort (marker.begin(),marker.end());
  if (marker[jisuu]<0)
  {
    marker[jisuu]=0;
  }
  cout << marker[jisuu];
}
  
    

Compiler output:
a.cc: In function 'int main()':
a.cc:33:8: error: 'i' was not declared in this scope
   33 |   for (i=1; i<=jisuu; i++)
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  string S;
  cin >> S;
  int jisuu;
  jisuu = S.size();
  vector <int> count(jisuu);
  vector <int> marker(jisuu);
  count <int> count2(jisuu);
  int j=0;
  for (int i=0;i<jisuu;i++)
  {
    if (S.at(i) == 'A' || S.at(i) == 'T' || S.at(i) == 'G' || S.at(i) == 'C')
    {
      count[i]=1;
    }
    else
    {
      count[i]=0;
    }
  }
  for (int i=0;i<jisuu;i++)
  {
    if (count[i]==0)
    {
      marker[j]=i;
      j++;
    }
  }
  count2[0]=marker[0];
  for (i=1; i<=jisuu; i++)
  {
    count2[i]=marker[i-1] - marker[i];
  }
  sort (marker.begin(),marker.end());
  if (marker[jisuu]<0)
  {
    marker[jisuu]=0;
  }
  cout << marker[jisuu];
}
  
    

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: expected primary-expression before 'int'
   11 |   count <int> count2(jisuu);
      |          ^~~
a.cc:32:3: error: 'count2' was not declared in this scope; did you mean 'count'?
   32 |   count2[0]=marker[0];
      |   ^~~~~~
      |   count
a.cc:33:8: error: 'i' was not declared in this scope
   33 |   for (i=1; i<=jisuu; i++)
      |        ^
Language: C++

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

int main() {
    string s;
    cin >> s;
    int len = 0;
    int maxlen = 0;
    unordered_set<char> atgc = { 'A', 'T', 'G', 'C' };
    for (char c : s) {
        if (atgc.find(c) != atgc.end()) {
            len++;
            maxlen = max(maxlen, len);
        else {
            len = 0;
        }
    }
    cout << maxlen << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: expected '}' before 'else'
   16 |         else {
      |         ^~~~
a.cc:13:41: note: to match this '{'
   13 |         if (atgc.find(c) != atgc.end()) {
      |                                         ^
Language: C++

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

int main() {
    string s;
    cin >> s;
    int len = 0;
    int maxlen = 0;
    unordered_set<char> atgc = { 'A', 'T', 'G', 'C' };
    for (char c : s) {
        if (atgc.find(c) != atgc.end()) {
            len++;
            maxlen = max(maxlen, len);
        else {
            len = 0;
        }
    }
    cout << maxlen << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'unordered_set' was not declared in this scope
   10 |     unordered_set<char> atgc = { 'A', 'T', 'G', 'C' };
      |     ^~~~~~~~~~~~~
a.cc:2:1: note: 'std::unordered_set' is defined in header '<unordered_set>'; this is probably fixable by adding '#include <unordered_set>'
    1 | #include <iostream>
  +++ |+#include <unordered_set>
    2 | #include <string>
a.cc:10:19: error: expected primary-expression before 'char'
   10 |     unordered_set<char> atgc = { 'A', 'T', 'G', 'C' };
      |                   ^~~~
a.cc:12:13: error: 'atgc' was not declared in this scope
   12 |         if (atgc.find(c) != atgc.end()) {
      |             ^~~~
a.cc:15:9: error: expected '}' before 'else'
   15 |         else {
      |         ^~~~
a.cc:12:41: note: to match this '{'
   12 |         if (atgc.find(c) != atgc.end()) {
      |                                         ^
Language: C++

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

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    for(int i=0;i<s.size();++i)
    {
        if(s[i]!='A' && s[i]!='G' && s[i]!='T' && s[i]!='C')
            s[i]='.';
    }
    int c=0,ans=-1;
    for(int i=0;i<s.size();++i)
    {
        if(s[i]=='.')
        {
            ans=max(ans,co);
            co=0;
        }
        else c++;
    }
    cout<<ans;
    return 0;
}


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

#include<cstdlib>
#include<climits>
#include<fstream>
using namespace std;
int main() {
	string S;
	cin >> S;
	int ans = 0;
	int tmp = 0;
	for (int i = 0; i<S.size(); i++) {
		if (S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T') {
			tmp += 1;
		}
		else {
			tmp = 0;
		}
		if (ans < tmp) {
			ans = tmp;
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> S;
      |         ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<fstream>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:21:9: error: 'cout' was not declared in this scope
   21 |         cout << ans << endl;
      |         ^~~~
a.cc:21:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; 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 FORR(i, m, n) for (int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define ull unsigned long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

int main()
{
    string s;
    cin >> s;
    int l = 0, m = 0;#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; 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 FORR(i, m, n) for (int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define ull unsigned long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

int main()
{
    string s;
    cin >> s;
    int l = 0, m = 0;
    REP(i, s.length())
    {
        if (s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G')
            l++;
        else
        {
            m = max(m, l);
            l = 0;
        }
    }

    cout << m << endl;
}

    REP(i, s.length())
    {
        if (s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G')
            l++;
        else
            m = max(m, l);
    }
    cout << m << endl;
}


Compiler output:
a.cc:25:22: error: stray '#' in program
   25 |     int l = 0, m = 0;#include <bits/stdc++.h>
      |                      ^
a.cc: In function 'int main()':
a.cc:25:23: error: 'include' was not declared in this scope
   25 |     int l = 0, m = 0;#include <bits/stdc++.h>
      |                       ^~~~~~~
a.cc:25:32: error: 'bits' was not declared in this scope
   25 |     int l = 0, m = 0;#include <bits/stdc++.h>
      |                                ^~~~
a.cc:25:37: error: 'stdc' was not declared in this scope; did you mean 'std'?
   25 |     int l = 0, m = 0;#include <bits/stdc++.h>
      |                                     ^~~~
      |                                     std
a.cc:36:1: error: expected primary-expression before 'using'
   36 | using namespace std;
      | ^~~~~
a.cc:45:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   45 | int main()
      |         ^~
a.cc:45:9: note: remove parentheses to default-initialize a variable
   45 | int main()
      |         ^~
      |         --
a.cc:45:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:46:1: error: a function-definition is not allowed here before '{' token
   46 | {
      | ^
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <map>
#include <numeric>
#include <type_traits>
#include <limits>
#include <random>
#include <iomanip>

using namespace std;

using ll = long long;

typedef pair<ll, ll> P;

#define rep(i,N) for(long long i = 0;i < (long long)N; ++i)

static int mod = 1000000007;
static int large_int = 1000000000;
static ll large_ll = 1000000000000000000;

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

string str, ans;

int main() {
	cin >> str;
	for each (char sec in str)
	{
		if (sec == 'A' || sec == 'G' || sec == 'T' || sec == 'C') {
			ans += sec;
		}
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:13: error: expected '(' before 'each'
   34 |         for each (char sec in str)
      |             ^~~~
      |             (
a.cc:34:19: error: expected primary-expression before 'char'
   34 |         for each (char sec in str)
      |                   ^~~~
a.cc:34:13: error: 'each' was not declared in this scope
   34 |         for each (char sec in str)
      |             ^~~~
a.cc:41:1: error: expected primary-expression before '}' token
   41 | }
      | ^
a.cc:40:29: error: expected ')' before '}' token
   40 |         cout << ans << endl;
      |                             ^
      |                             )
   41 | }
      | ~                            
a.cc:34:13: note: to match this '('
   34 |         for each (char sec in str)
      |             ^~~~
a.cc:41:1: error: expected primary-expression before '}' token
   41 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  int i, j;
  cin>>s;
  int ans=0;
  for(i=0;i<n;i++)
    {
        for(j=1;i+j-1<s.size();j++)
          {
          string t=s.substr(i,j);
          bool poss=1;
          for(int k=0;k<t.size();k++)
            if(t[k]!='A'&&t[k]!='T'&&t[k]!='C'&&t[k]!='G')  
        poss=false;
          if(poss)
            ans=max(j,ans);
            }
    }
  cout<<ans<<endl;
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
    string S; cin >> S;
    int ans0 = 0;
    int ans1 = 0;
    for(int i = 0 ; i < S.size() ; i++){
        if(S[i] == 'A' ||S[i] == 'T' ||S[i] == 'G' ||S[i] == 'C'){
            ans1 ++;
        } else{
            ans0 = max(ans0 , ans1)
            ans1 = 0;
        }
    }
    ans0 = max(ans0 , ans1);
    cout << ans0 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:36: error: expected ';' before 'ans1'
   11 |             ans0 = max(ans0 , ans1)
      |                                    ^
      |                                    ;
   12 |             ans1 = 0;
      |             ~~~~
Language: C++

#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){
  string s;
  vector<int> ans;
  cin >> s;
  bool last = false;
  for(int i=0;i<(int)s.size();++i){
    if((s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T')&&last){
      ++ans.back();
    }else if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T'){
      ans.emplace_back(1);
      last = true;
    }else{
      last = false;
    }
  }
  if(ans.size()==0){
    puts("0");
    return 0;
  }
  cout << *max_element(ans.begin(),ans.end()) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:12: error: 'max_element' was not declared in this scope
   24 |   cout << *max_element(ans.begin(),ans.end()) << endl;
      |            ^~~~~~~~~~~
Language: Java

import java.io.*;
import java.lang.invoke.DelegatingMethodHandle$Holder;
import  java.util.*;
import static java.lang.System.in;

public class Main{
    static int n,m;
    static long[] head,pos;
    public static void main(String[] args)throws IOException{
        Scanner sc = new Scanner(System.in);
        //BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        //String[] buf = reader.readLine().split(" ");
        char[] s = sc.next().toCharArray();
        char[] di = new char[]{'A','C','G','T'};
        HashSet<Character> dic = new HashSet<>();
        for(char w:di) dic.add(w);
        int ans = 0;
        for(int i=0;i<s.length;i++){
            if(!dic.contains(s[i])) continue;
            int j = i+1;
            while(j<s.length&&dic.contains(s[j])) j++;
            ans = Math.max(ans,j-i);
        }
        System.out.println(ans);
    }
}


Compiler output:
Main.java:2: error: DelegatingMethodHandle.Holder is not public in DelegatingMethodHandle; cannot be accessed from outside package
import java.lang.invoke.DelegatingMethodHandle$Holder;
                       ^
1 error
Language: C++

#include <iostream>
using namespace std;

int main(){
  string s, ret="", tmp="";
  cin >> s;
  for(int i=0; i<n; iLL++){
    if(s[i]=='A' || s[i]=='C' || s[i]=='G' || s[i]=='T')tmp.push_back(s[i]);
    else tmp="";
    if(ret.size()<tmp.size()){
      ret=tmp;
    }
  }
  cout << ret;
  return 0;
}
  
  

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

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

int main() {
  int cnt=0,ans=0;
  string str;
  cin >> str;
  for(int i=0; i<str.size()+ i++) {
    if(str[i]=='A'||str[i]=='T'||str[i]=='G'||str[i]=='C') {
      cnt++;
    }
    else {
      cnt=0;
    }
    if(cnt>ans) {
      ans=cnt;
    }
  }
  cout << ans << endl;
}


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

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

int main() {
  int cnt=0,ans=0;
  string str;
  cin >> str;
  for(int i=0; i<vec.size()+ i++) {
    if(str[i]=='A'||str[i]=='T'||str[i]=='G'||str[i]=='C') {
      cnt++;
    }
    else {
      cnt=0;
    }
    if(cnt>ans) {
      ans=cnt;
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: 'vec' was not declared in this scope
    8 |   for(int i=0; i<vec.size()+ i++) {
      |                  ^~~
a.cc:8:33: error: expected ';' before ')' token
    8 |   for(int i=0; i<vec.size()+ i++) {
      |                                 ^
      |                                 ;
Language: C++

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

int main() {
  int cnt=0,ans=0;
  string str;
  cin >> str;
  for(int i=0; i<vec.size()+ i++) {
    if(vec[i]=='A'||vec[i]=='T'||vec[i]=='G'||vec[i]=='C') {
      cnt++;
    }
    else {
      cnt=0;
    }
    if(cnt>ans) {
      ans=cnt;
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: 'vec' was not declared in this scope
    8 |   for(int i=0; i<vec.size()+ i++) {
      |                  ^~~
a.cc:8:33: error: expected ';' before ')' token
    8 |   for(int i=0; i<vec.size()+ i++) {
      |                                 ^
      |                                 ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin>>s;
    int sum=1,k=0;
    int n=s.size();
    vector<int> vect(10)={0,0,0,0,0,0,0,0,0,0};
    for(int i=0;i<n;i++){
        if(s.at(i)=='A'||
        s.at(i)=='C'||
        s.at(i)=='G'||
        s.at(i)=='T'){
            k++;
        }
    }
    if(k==0){
        goto exit;
    }
 
    for(int i=0;i<n-1;i++){
        if((s.at(i)=='A'||
        s.at(i)=='C'||
        s.at(i)=='G'||
        s.at(i)=='T')&&(
        s.at(i+1)=='A'||
        s.at(i+1)=='C'||
        s.at(i+1)=='G'||
        s.at(i+1)=='T')){
            sum++;
            vect[i]=sum;
 
        }else{
            vect[i]=sum;
            sum=1;
        }
 
        
    }
    sort(vect.begin(),vect.end());
 
    
    exit:
 
    cout<<vect[9]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: expected ',' or ';' before '=' token
    8 |     vector<int> vect(10)={0,0,0,0,0,0,0,0,0,0};
      |                         ^
Language: C++

#include<cstdio>
#include<string>
#include<vector>
#include<algorithm>
#include<cstring>
using namespace std;
int main(){

    char pat[5]="ACGT";
    char s[];
    int count=0;
    int result=0;
    bool flg=false;
    scanf("%s",s);
    for(int i=0;i<strlen(s); i++)
	{
        for(int j=0;j<5;j++)
            if(s[i]==pat[j])
                flg=true;
        if(flg)
            count++;
		else if(result<count)
		{
            result=count;
            count=0;
        }
        flg=false;
    }
    if(result<count)
        result=count;
    printf("%d",result);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: storage size of 's' isn't known
   10 |     char s[];
      |          ^