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

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

int main()
{
	string S, a;
	int N;
	cin >> N;
	//文字コード
	int a = 'A';

	for (int i = 0; i < S.size(); i++)
	{
		int r = (int(S[i]) - a + n) % 26;
		cout << (char)(t + a);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: conflicting declaration 'int a'
   11 |         int a = 'A';
      |             ^
a.cc:7:19: note: previous declaration as 'std::string a'
    7 |         string S, a;
      |                   ^
a.cc:15:36: error: no match for 'operator-' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   15 |                 int r = (int(S[i]) - a + n) % 26;
      |                          ~~~~~~~~~ ^ ~
      |                          |           |
      |                          int         std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/string:48,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   template argument deduction/substitution failed:
a.cc:15:38: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
   15 |                 int r = (int(S[i]) - a + n) % 26;
      |                                      ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   template argument deduction/substitution failed:
a.cc:15:38: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
   15 |                 int r = (int(S[i]) - a + n) % 26;
      |                                      ^
a.cc:15:42: error: 'n' was not declared in this scope
   15 |                 int r = (int(S[i]) - a + n) % 26;
      |                                          ^
a.cc:16:32: error: 't' was not declared in this scope
   16 |                 cout << (char)(t + a);
      |                                ^
Language: C

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

main(){
	int N;
	int i=0;
	char S[10000];
	scanf("%d",&N);
	scanf("%s",&S);
	
	
	while(S[i]!='\0'){
		if(S[i]+N>90){
			S[i] = 64 + (S[i]+N-900
ABCXYZ0
ABCXYZ0
ABCXYZ);
		}
		else{
			S[i] = S[i]+N;
		}
		i++;
	}
	puts(S);
}

Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main(){
      | ^~~~
main.c: In function 'main':
main.c:14:48: error: expected ')' before 'ABCXYZ0'
   14 |                         S[i] = 64 + (S[i]+N-900
      |                                     ~          ^
      |                                                )
   15 | ABCXYZ0
      | ~~~~~~~
Language: Java

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		//65~90 A~Z
		int N = scan.nextInt();
		String S = scan.next();
		
		StringBuilder sb = new StringBuilder();
		char[] charArray = S.toCharArray();
		for(char c: charArray) {
			int targetIndex = c + N;
			if(targetIndex > 90) {
				targetIndex -= 26;
			}
			char changedChar = (char)targetIndex;
			sb.append(changedChar);
		}
		
		System.out.println(sb);
		scan.close();
	}
}


Compiler output:
Main.java:3: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		                   ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
prep(char a[],int cut)
{
	static int j=0;
	int cuts=cut;
	int len=strlen(a);
	while(cuts<len)
	{
		
		for(int i=0;i<=cut;i++)
		{
		if(int(a[cuts]+i)>90)
		{
		a[cuts]=65;
		i=0;
		--cut; }
		cout<<char(a[cuts]+i);
	}
    cuts+=cut+1;
}
}
int main()
{
	char a[26];
	int cut;
	cin>>cut>>a;
	prep(a,cut);
}

Compiler output:
a.cc:3:1: error: ISO C++ forbids declaration of 'prep' with no type [-fpermissive]
    3 | prep(char a[],int cut)
      | ^~~~
a.cc: In function 'int prep(char*, int)':
a.cc:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
   22 | }
      | ^
Language: C++

#include<iostream.h>
using namespace std;
int main(){
  string s;
  int n,x,i;
  cin>>n>>s;
  n%=26;
  int l=s.length();
  for(i=0;i<l;++i){
  	x=s[i]-'A';
    x+=n;
    x%=26;
    s[i]='A'+x;
  }
  cout<<s;
  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  for(int i=0; i<s.size(); i++) {
    s[i] = (s[i] - 'A' + n) % 26 + 'A';
  }
  cout << s << endl;
  returm 0;
}

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

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

int main(){
  int n;
  string s;
  cin>>n;
  cin>>s;
  
  for(int i=0;i<s.length;i++){
    s[i]+=n;
    if(s[i]>'Z')s[i]-=26;
    cout<<s[i];
  }
  cout<<endl;
}
    

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

#include <iostream>
using namespace std;
int main(){
  int n;
  string s;
  cin>>n;
  cin>>s;
  char c[s.length()];
  for(int i=0;i<s.length();i++){
    x='Z'-s.at(i);
    if(x>=n){
      s.at(i)+=n;
    }
    else{
      s.at(i)='A'+(n-x-1);
    }
    cout<<s.at(i);
  }
  cout<<endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'x' was not declared in this scope
   10 |     x='Z'-s.at(i);
      |     ^
Language: Java

import java.util.HashMap;
import java.util.Scanner;

/**
 * @author zhangyong1@oneship.cc
 */
public class Solution {

    public static void main(String[] args) {
        String letter =
                "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        String str = in.next();
        HashMap<Character, Integer> map = new HashMap<>();
        for (int i = 0; i < letter.length(); i++) {
            map.put(letter.charAt(i), i);
        }
        for (int i = 0; i < str.length(); ++i) {
            System.out.print(letter.charAt((map.get(str.charAt(i)) + n) % 26));
        }
        System.out.println();
    }
}

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

#include<string>
#include<iostream>

using namespace;

int main(){
	int n;
  	string str;
  	cin >> n >> str;
  	string res;
  	for(int i=0; i<str.length(); ++i){
    	int pos = n;
      	res = res + str[(n+i)%str.length()];
    }
  return res;
}

Compiler output:
a.cc:4:16: error: expected identifier before ';' token
    4 | using namespace;
      |                ^
a.cc: In function 'int main()':
a.cc:8:9: error: 'string' was not declared in this scope
    8 |         string str;
      |         ^~~~~~
a.cc:8:9: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |         cin >> n >> str;
      |         ^~~
      |         std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:21: error: 'str' was not declared in this scope; did you mean 'std'?
    9 |         cin >> n >> str;
      |                     ^~~
      |                     std
a.cc:10:15: error: expected ';' before 'res'
   10 |         string res;
      |               ^~~~
      |               ;
a.cc:13:9: error: 'res' was not declared in this scope
   13 |         res = res + str[(n+i)%str.length()];
      |         ^~~
a.cc:15:10: error: 'res' was not declared in this scope
   15 |   return res;
      |          ^~~
Language: C

#include <stdio.h>

int main(void){
  int n, i;
  char str[100];
  scanf("%d", &n);
  scanf("%s", str);
  for(i=0; i<(sizeof str / sizeof str[0]), i++){
    printf("%s", (&str[i])+n);
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:47: error: expected ';' before ')' token
    8 |   for(i=0; i<(sizeof str / sizeof str[0]), i++){
      |                                               ^
      |                                               ;
Language: C++

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

int main(){
  int N;
  string S;
  cin>>N;
  cin>>S;
  for(int i=0;i<S.size();i++){
    if(S[i]+N>'Z'){
      S[i]-=(26-N)
    }else{
    S[i]+=N;
  }
  }
  cout<<S<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: expected ';' before '}' token
   12 |       S[i]-=(26-N)
      |                   ^
      |                   ;
   13 |     }else{
      |     ~
Language: Java

import java.util.Scanner;

class Main{
	public static String shiftChar(int num, String str){
    	char[] ch = str.toCharArray();
      int length = ch.length;
      int temp = 0;
      char ch = '0';
      String result = "";
      
      for(int i = 0;i< length; i++){
      	int input = ch[i];
        int value = input + num;
        if(value > 90){
        	temp = value - 90+ 65;
          ch = (char)temp;
          result += ch;
        }else{
        	ch = (char)value;
          result += ch;
        }
      }
      return result;
    }
  public static void main(String[] agrs){
  	Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
    String str = sc.next();
    System.out.println(shiftChar(num,str));
  }
}

Compiler output:
Main.java:8: error: variable ch is already defined in method shiftChar(int,String)
      char ch = '0';
           ^
Main.java:12: error: array required, but char found
      	int input = ch[i];
      	              ^
2 errors
Language: Java

import java.util.Scanner;
public final class Main {
    public static final void main(String[] d) {
        final String dic = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        final String target = new Scanner(System.in).next();
        final StringBuilder ret = new StringBuilder(target.length);
        final int offset = 3;
        for (int i = 0; i < target.length; i++) {
            ret.append(dic.charAt((target.charAt(i) - 65 + offset) % 26));
        }
        System.out.println(ret);
    }
}

Compiler output:
Main.java:6: error: cannot find symbol
        final StringBuilder ret = new StringBuilder(target.length);
                                                          ^
  symbol:   variable length
  location: variable target of type String
Main.java:8: error: cannot find symbol
        for (int i = 0; i < target.length; i++) {
                                  ^
  symbol:   variable length
  location: variable target of type String
2 errors
Language: Java

import java.util.Scanner;
public final class Caesar {
    public static final void main(String[] d) {
        final String dic = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        final String target = new Scanner(System.in).next();
        final StringBuilder ret = new StringBuilder(target.length);
        final int offset = 3;
        for (int i = 0; i < target.length; i++) {
            ret.append(dic.charAt((target.charAt(i) - 65 + offset) % 26));
        }
        System.out.println(ret);
    }
}

Compiler output:
Main.java:2: error: class Caesar is public, should be declared in a file named Caesar.java
public final class Caesar {
             ^
Main.java:6: error: cannot find symbol
        final StringBuilder ret = new StringBuilder(target.length);
                                                          ^
  symbol:   variable length
  location: variable target of type String
Main.java:8: error: cannot find symbol
        for (int i = 0; i < target.length; i++) {
                                  ^
  symbol:   variable length
  location: variable target of type String
3 errors
Language: C++

#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int main{
  int n;
  char a[10005]
  scanf("%d",&n);
  cin.getline(a,10005);
  for(int i=0;i<strlen(a);i++){
    int t=a[i]-'A';
    t=(t+n)%26;
    printf("%c",'A'+t);
  }
  printf("\n");
  return 0;
}

Compiler output:
a.cc:5:5: error: cannot declare '::main' to be a global variable
    5 | int main{
      |     ^~~~
a.cc:6:3: error: expected primary-expression before 'int'
    6 |   int n;
      |   ^~~
a.cc:6:3: error: expected '}' before 'int'
a.cc:5:9: note: to match this '{'
    5 | int main{
      |         ^
a.cc:8:3: error: expected initializer before 'scanf'
    8 |   scanf("%d",&n);
      |   ^~~~~
a.cc:9:3: error: 'cin' does not name a type
    9 |   cin.getline(a,10005);
      |   ^~~
a.cc:10:3: error: expected unqualified-id before 'for'
   10 |   for(int i=0;i<strlen(a);i++){
      |   ^~~
a.cc:10:15: error: 'i' does not name a type
   10 |   for(int i=0;i<strlen(a);i++){
      |               ^
a.cc:10:27: error: 'i' does not name a type
   10 |   for(int i=0;i<strlen(a);i++){
      |                           ^
a.cc:15:9: error: expected constructor, destructor, or type conversion before '(' token
   15 |   printf("\n");
      |         ^
a.cc:16:3: error: expected unqualified-id before 'return'
   16 |   return 0;
      |   ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: C++

#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int main(){
  int n;
  char a[10005];
  scanf("%d",&n);
  cin.getline(a,10005);
  for(int i=0;i<strlen(a);i++){
    int t=a[i]-'A';
    t=(t+N)%26;
    printf("%c",'A'+t);
  }
  printf("\n");
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'N' was not declared in this scope
   12 |     t=(t+N)%26;
      |          ^
Language: C++

#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int main{
  int n;
  char a[10005];
  scanf("%d",&n);
  cin.getline(a,10005);
  for(int i=0;i<strlen(a);i++){
    int t=a[i]-'A';
    t=(t+N)%26;
    printf("%c",'A'+t);
  }
  printf("\n");
  return 0;
}

Compiler output:
a.cc:5:5: error: cannot declare '::main' to be a global variable
    5 | int main{
      |     ^~~~
a.cc:6:3: error: expected primary-expression before 'int'
    6 |   int n;
      |   ^~~
a.cc:6:3: error: expected '}' before 'int'
a.cc:5:9: note: to match this '{'
    5 | int main{
      |         ^
a.cc:8:8: error: expected constructor, destructor, or type conversion before '(' token
    8 |   scanf("%d",&n);
      |        ^
a.cc:9:3: error: 'cin' does not name a type
    9 |   cin.getline(a,10005);
      |   ^~~
a.cc:10:3: error: expected unqualified-id before 'for'
   10 |   for(int i=0;i<strlen(a);i++){
      |   ^~~
a.cc:10:15: error: 'i' does not name a type
   10 |   for(int i=0;i<strlen(a);i++){
      |               ^
a.cc:10:27: error: 'i' does not name a type
   10 |   for(int i=0;i<strlen(a);i++){
      |                           ^
a.cc:15:9: error: expected constructor, destructor, or type conversion before '(' token
   15 |   printf("\n");
      |         ^
a.cc:16:3: error: expected unqualified-id before 'return'
   16 |   return 0;
      |   ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: C++

#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int main{
  int n;
  char a[10005]
  scanf("%d",&n);
  cin.getline(a,10005);
  for(int i=0;i<strlen(a);i++){
    int t=a[i]-'A';
    t=(t+N)%26;
    printf("%c",'A'+t);
  }
  printf("\n");
  return 0;
}


Compiler output:
a.cc:5:5: error: cannot declare '::main' to be a global variable
    5 | int main{
      |     ^~~~
a.cc:6:3: error: expected primary-expression before 'int'
    6 |   int n;
      |   ^~~
a.cc:6:3: error: expected '}' before 'int'
a.cc:5:9: note: to match this '{'
    5 | int main{
      |         ^
a.cc:8:3: error: expected initializer before 'scanf'
    8 |   scanf("%d",&n);
      |   ^~~~~
a.cc:9:3: error: 'cin' does not name a type
    9 |   cin.getline(a,10005);
      |   ^~~
a.cc:10:3: error: expected unqualified-id before 'for'
   10 |   for(int i=0;i<strlen(a);i++){
      |   ^~~
a.cc:10:15: error: 'i' does not name a type
   10 |   for(int i=0;i<strlen(a);i++){
      |               ^
a.cc:10:27: error: 'i' does not name a type
   10 |   for(int i=0;i<strlen(a);i++){
      |                           ^
a.cc:15:9: error: expected constructor, destructor, or type conversion before '(' token
   15 |   printf("\n");
      |         ^
a.cc:16:3: error: expected unqualified-id before 'return'
   16 |   return 0;
      |   ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: Java

import java.util.Scanner;
class Main
{
    public static void main(String[] args)
    {
        int a;//何文字後か
        String str;
        String str2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        String [] sa2 = str2.split("");
        Scanner scan1 = new Scanner(System.in);
        Scanner scan2 = new Scanner(System.in);
        a = scan1.nextInt();
        str = scan2.nextLine();
        String [] sa = str.split("");//から文字で区切り配列に格納
        for(int i=0;i<str.length();i++){
            sa[i] = sa2[]; //剰余で何文字ずれるか計算
            System.out.print(sa[i]);
        }
        System.out.println("");
    }
}


Compiler output:
Main.java:16: error: '.class' expected
            sa[i] = sa2[]; //????????????
                         ^
1 error
Language: C++

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

int main()
{
    int n;
    string s;
    cin >> n;
    cin >> s;

    int size = s.length();
    for(int i=0;i<s.length;i++){
        int x = s[i] - 'A';

        x = (x + n) % 26;
        putchar('A' + x);
    }

}

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

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

int main()
{
    int n;
    string s;
    cin >> n;
    cin >> s;

    int size = s.length();
    for(int i=0;i<length;i++){
        int x = s[i] - 'A';

        x = (x + n) % 26;
        putchar('A' + x);
    }

}

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

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

int main(){
  int n; 
  string s;
  cin >> n >> s;
  for(i=0; i<s.length(); i++){
    int x = s[i] - 'A';
    x = (n+x)%26;
    cout << char('A' + x);
  }
}


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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  string S;
  string alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  cin>>N>>S;
  int A=s.size();
  vector<int>n(A);
  for(int i=0;i<A;i++){
    for(int j=0;j<26;j++){
      if(S.at(i)==alpha.at(j)) n[i]=j;
    }
  }
  for(int i=0;i<A;i++){
    S.at(i)=alpha.at((n[i]+N)%26);
    cout<<S.at(i);
  }
  cout<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 's' was not declared in this scope
    8 |   int A=s.size();
      |         ^
Language: C++

#include <iostream>
using namespace std;

char changeChar(char c,int p){
  alpha = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
  for(int i=0;i<26;i++){
    if(c==alpha[i]){
      return alpha[(i+p)%26];
    }
  }
}

int main(){
  int  n;
  cin >> n;
  string s;
  cin >> s;
  for(int i=0;i<s.length();i++){
    s[i] == changeChar(s[i],n);
  }
  cout << s << endl;
  return 0;
}

Compiler output:
a.cc: In function 'char changeChar(char, int)':
a.cc:5:3: error: 'alpha' was not declared in this scope; did you mean 'isalpha'?
    5 |   alpha = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
      |   ^~~~~
      |   isalpha
Language: C++

#include <map>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

int main(){
    int n;
    string s;

    cin >> s;
    rep(i,s.size()) {

        s[i] = (s[i] -'A' + n)%26 + 'A'; 
    }
    cout << s << endl;

    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'string' was not declared in this scope
    8 |     string s;
      |     ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    1 | #include <map>
  +++ |+#include <string>
    2 | #define rep(i, n) for(int i = 0; i < n; i++)
a.cc:10:5: error: 'cin' was not declared in this scope
   10 |     cin >> s;
      |     ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <map>
  +++ |+#include <iostream>
    2 | #define rep(i, n) for(int i = 0; i < n; i++)
a.cc:10:12: error: 's' was not declared in this scope
   10 |     cin >> s;
      |            ^
a.cc:15:5: error: 'cout' was not declared in this scope
   15 |     cout << s << endl;
      |     ^~~~
a.cc:15:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:18: error: 'endl' was not declared in this scope
   15 |     cout << s << endl;
      |                  ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <map>
  +++ |+#include <ostream>
    2 | #define rep(i, n) for(int i = 0; i < n; i++)
Language: Java

public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	System.out.print("num: ");
	    int n = sc.nextInt();
	    String s = sc.next();
	    char[] c = s.toCharArray();
	    int len = s.length();
	    for (int i = 0; i < len; i ++) {
	      if (c[i] + n > 'Z') {
	        System.out.print((char)(c[i] + n - 26));
	      } else {
	        System.out.print((char)(c[i] + n));
	      }
	    }
	    System.out.println();
	}
}

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

#include <stdio.h>

int n;
char given_string[10000];

int main() {
  scanf("%d", &n);
  scanf("%s", given_string);
  for (size_t i = 0; i < 10000; i++) {
    if (65 <= given_string[i] <= 90) {
      given_string[i] += n;
      if (given_string[i] > 90) given_string -= 26;
    }
  }
  printf("%s", given_string);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:46: error: assignment to expression with array type
   12 |       if (given_string[i] > 90) given_string -= 26;
      |                                              ^~
Language: Java

import java.util.Scanner;

class Contest_B{
    public static void main(String[] args){
        final String ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        int n;
        
        Scanner scan = new Scanner(System.in);
        int ch = sc.nextInt();
        String str = sc.next();
        StringBuilder r = new StringBuilder();

        for(int i = 0;i < str.length();i++){
            char c = str.charAt(i);
            n = ALPHA.indexOf(c) + ch;
            if(n >= 26) n = n - 26;
            r.append(ALPHA.charAt(n));
        }
            String result = new String(r);   
            System.out.println(result);
    }
}

Compiler output:
Main.java:9: error: cannot find symbol
        int ch = sc.nextInt();
                 ^
  symbol:   variable sc
  location: class Contest_B
Main.java:10: error: cannot find symbol
        String str = sc.next();
                     ^
  symbol:   variable sc
  location: class Contest_B
2 errors
Language: Java

import java.util.Scanner;

class Contest_B{
    public static void main(String[] args){
        final String ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        int n;
        
        Scanner sc = new Scanner(System.in);
        int ch = sc.nextInt();
        String str = sc.next();
        String result = "";

        for(int i = 0;i < str.length();i++){
            char c = str.charAt(i);
            n = ALPHA.indexOf(c) + ch;
            if(n >= 26) n = n - 26;
            result.concat((String)ALPHA.charAt(n));
        }
            
            System.out.println(result);
    }
}

Compiler output:
Main.java:17: error: incompatible types: char cannot be converted to String
            result.concat((String)ALPHA.charAt(n));
                                              ^
1 error
Language: C++

#include <iostream>
#include <string>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(){
  int n;
  string s;
  cin >> n
  cin >> s;
  rep(i,s.size()){
    if(s[i] + n > 90) s[i] = s[i] + n - 90;
    else s[i] = s[i] + n;
    }
    cout << s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: expected ';' before 'cin'
    9 |   cin >> n
      |           ^
      |           ;
   10 |   cin >> s;
      |   ~~~
Language: C++


int n;
string s;

int main(){
	cin>>n>>s;
	for(int i=0;i<s.size();i++) cout<<(char)((s[i]-'A'+n)%26+'A');
	cout<<endl;
}

Compiler output:
a.cc:3:1: error: 'string' does not name a type
    3 | string s;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin>>n>>s;
      |         ^~~
a.cc:6:17: error: 's' was not declared in this scope
    6 |         cin>>n>>s;
      |                 ^
a.cc:7:37: error: 'cout' was not declared in this scope
    7 |         for(int i=0;i<s.size();i++) cout<<(char)((s[i]-'A'+n)%26+'A');
      |                                     ^~~~
a.cc:8:9: error: 'cout' was not declared in this scope
    8 |         cout<<endl;
      |         ^~~~
a.cc:8:15: error: 'endl' was not declared in this scope
    8 |         cout<<endl;
      |               ^~~~
Language: C

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

using namespace std;
int main()
{
    int n;
    int i;
    char s[10000];
    scanf("%d",&n);
    scanf("%s", s);
//    printf("%d", strlen(s));
    for (i=0; i<strlen(s); i++){
        int tmp;
        tmp = (((s[i]+n)-65)%26)+65;
        printf("%c",tmp);
    }
    return 0;
}


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

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

using namespace std;
int main()
{
    int n;
    int i;
    char s[10000];
    scanf("%d",&n);
    scanf("%s", s);
//    printf("%d", strlen(s));
    for (i=0; i<strlen(s); i++){
        int tmp;
        tmp = (((s[i]+n)-65)%26)+65;
        printf("%c",tmp);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'strlen' was not declared in this scope
   13 |     for (i=0; i<strlen(s); i++){
      |                 ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string>
  +++ |+#include <cstring>
    3 |
Language: C++

#include <bits/stdc++.h>

int main(void)
{
  int N; cin >> N;
  string S; cin >> S;
  for(int i = 0; i < S.size(); i++)
  {
  	S.at(i) += N;
  }
  cout << S;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   int N; cin >> N;
      |          ^~~
      |          std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string S; cin >> S;
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:20: error: 'S' was not declared in this scope
    6 |   string S; cin >> S;
      |                    ^
a.cc:11:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |   cout << S;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: Java

import java.util.*;
public class Main{
public static void main(String[] args){
Scanner s=new Scanner(System.in);
int len=s.nextInt();
  String string=s.next();
  char[] arr=string.toCharArray();
  for(int j=0;j<arr.length;j++){
  for(int i=0;i<len;i++){
  ++arr[j];
  }
  }
  System.out.println(Arrays.toString(arr).subString(1,3*arr.length-1).replaceAll(", ",""));
}}

Compiler output:
Main.java:13: error: cannot find symbol
  System.out.println(Arrays.toString(arr).subString(1,3*arr.length-1).replaceAll(", ",""));
                                         ^
  symbol:   method subString(int,int)
  location: class String
1 error
Language: Java

import java.util.*;
public class Main{
public static void main(String[] args){
Scanner s=new Scanner(System.in);
int len=s.nextInt();
  String string=s.next();
  char[] arr=string.toCharArray();
  for(char a:arr){
  a=a+len;
  }
  System.out.println(arr.toString());
}}

Compiler output:
Main.java:9: error: incompatible types: possible lossy conversion from int to char
  a=a+len;
     ^
1 error
Language: C++

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

int main(){
  int n;
  string s;
  cin >> n >> s;
  for(int i=0; i<s.length(), i++){
    s[i]=(s[i]-'A'+n)%26+'A';
  }
  cout << s;
  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main (){
  int n,length,i;
  string s;
  char x;
    cin>>n>>s;
  length  = s.length();
  for(i=0;i<n;i++){
    x = s[i];
    s[i] = s[length- n+i];
     s[length- n+i] = x;
  }
  cout<<s;
  return 0;


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

#include <bits/stdc++.h>
using namespace std;
int main (){
  int n,i;
  string s;
  char x;
    cin>>n>>s;
  for(i=0;i<n;i++){
    x = s[i];
    s[i] = s[strlen(s)- n+i];
     s[strlen(s)- n+i] = x;
  }
  cout<<s;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   10 |     s[i] = s[strlen(s)- n+i];
      |                     ^
      |                     |
      |                     std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc:11:15: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   11 |      s[strlen(s)- n+i] = x;
      |               ^
      |               |
      |               std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    char[] c=sc.next().toCharArray();
    for(int i=0;i<c.length;i++){
      c[i]=(char)((int)c[i]+n)%26;
    }
    System.out.println(String.valueOf(c));
  }
}

Compiler output:
Main.java:9: error: incompatible types: possible lossy conversion from int to char
      c[i]=(char)((int)c[i]+n)%26;
                              ^
1 error
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    char[] c=sc.next().toCharArray();
    for(int i=0;i<c.length;i++){
      c[i]=(char)((int)c[i]+n)%26;
    }
    System.out.println(String.valueOf(c);
  }
}

Compiler output:
Main.java:11: error: ')' or ',' expected
    System.out.println(String.valueOf(c);
                                        ^
1 error
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    char[] c=sc.next().toCharArray();
    for(int i=0;i<c.length;i++){
      c[i]=((int)c[i]+n)%26;
    }
    System.out.println(String.valueOf(c[i]));
  }
}

Compiler output:
Main.java:9: error: incompatible types: possible lossy conversion from int to char
      c[i]=((int)c[i]+n)%26;
                        ^
Main.java:11: error: cannot find symbol
    System.out.println(String.valueOf(c[i]));
                                        ^
  symbol:   variable i
  location: class Main
2 errors
Language: C++

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


signed main(){
  string s;int n;cin>>n>>s;
  for(char p:s){
    p+=n;
    if(p>='Z')p+=-'Z'+'A'-1;
    cout<<p<<endl;
  }


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

#include <iostream>
using namespace std;
int main(){
  int n;string;
  cin >> n >> s;
  for(auto&& i : s){
    i += n;
    if(132 < i)i -= 22;
  }
  cout << s;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: declaration does not declare anything [-fpermissive]
    4 |   int n;string;
      |         ^~~~~~
a.cc:5:15: error: 's' was not declared in this scope
    5 |   cin >> n >> s;
      |               ^
Language: C++

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

public class Main {

    private static FastReader in = new FastReader(System.in);
    private static PrintWriter out = new PrintWriter(System.out);

    private static final long MOD = (long) 1e9 + 7;

    public static void main(String[] args) {
        solve();
        out.flush();
    }

    private static void solve() {
        int n = in.nextInt();
        String s = in.next();
        String ans = "";
        for (char ch : s.toCharArray()) {
            int offset = ch - 'A';
            offset += n;
            offset %= 26;
            ans += String.valueOf((char) ('A' + offset));
        }
        out.println(ans);
    }

    // https://www.geeksforgeeks.org/fast-io-in-java-in-competitive-programming/
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader(InputStream inputStream) {
            br = new BufferedReader(new
                    InputStreamReader(inputStream));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        // https://qiita.com/masakinpo/items/5f77f2a879578a85a0bb
        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
}


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

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

int main(){
    string s;
    ll n;
    cin>>n>>s;
    for(ll i=0;i<s.size();i++){
        if(s[i]+n-1==Z){
            s[i]="A";
        }else{
            s[i]+=n;
        }
    }
    cout<<s<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: 'Z' was not declared in this scope
   13 |         if(s[i]+n-1==Z){
      |                      ^
a.cc:14:18: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   14 |             s[i]="A";
      |                  ^~~
      |                  |
      |                  const char*
Language: C++

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

#define F first
#define S second
typedef double db;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

ll gcd(ll x,ll y){
return y? gcd(y,x%y):x;
}

int main(){
  int n;
  cin>>n;
  string s;
  cin>>s;
  rep(i,s.size()){
    s[i]+=n;
    if(s[i]>90)s[i]-=26;
  }
  cout<<s<<endl;
return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc:11:9: error: 'pair' does not name a type
   11 | typedef pair<int,int> pii;
      |         ^~~~
a.cc:12:9: error: 'pair' does not name a type
   12 | typedef pair<ll,ll> pll;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:20:3: error: 'cin' was not declared in this scope
   20 |   cin>>n;
      |   ^~~
a.cc:21:3: error: 'string' was not declared in this scope
   21 |   string s;
      |   ^~~~~~
a.cc:22:8: error: 's' was not declared in this scope
   22 |   cin>>s;
      |        ^
a.cc:27:3: error: 'cout' was not declared in this scope
   27 |   cout<<s<<endl;
      |   ^~~~
a.cc:27:12: error: 'endl' was not declared in this scope
   27 |   cout<<s<<endl;
      |            ^~~~
Language: C++

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

int main(){
  int n; cin >> n;
  string s; cin >> s;
  
  for(int i = 0; i < s.length(); i++){
  
  	s[i] = (s[i] - 'A' + n)%26 + 'A';
  
    cout << s[i];
  }
  
  cout << endl;
}

Compiler output:
a.cc:1:24: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++>h>
      |                        ^
a.cc:1:10: fatal error: bits/stdc++>: No such file or directory
    1 | #include <bits/stdc++>h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;
import java.io.UnsupportedEncodingException;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        abc146_b solver = new abc146_b();
        solver.solve(1, in, out);
        out.close();
    }

    static class abc146_b {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            String S = in.next();
            byte[] asciiCodes;

            asciiCodes = S.getBytes("US-ASCII");

            for (int i = 0; i < asciiCodes.length; i++) {
                //System.out.println("asciiCodes[" + i + "]:" + asciiCodes[i]);
                asciiCodes[i] = (byte) (asciiCodes[i] + N <= 90 ? (asciiCodes[i] + N) : (65 + ((asciiCodes[i] + N) - 90) - 1));
                //System.out.println("asciiCodes[" + i + "]:" + asciiCodes[i]);
            }
            out.println(new String(asciiCodes, "US-ASCII"));
        }

    }
}



Compiler output:
Main.java:29: error: unreported exception UnsupportedEncodingException; must be caught or declared to be thrown
            asciiCodes = S.getBytes("US-ASCII");
                                   ^
Main.java:36: error: unreported exception UnsupportedEncodingException; must be caught or declared to be thrown
            out.println(new String(asciiCodes, "US-ASCII"));
                        ^
2 errors
Language: Java

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;
import java.io.UnsupportedEncodingException;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        abc146_b solver = new abc146_b();
        solver.solve(1, in, out);
        out.close();
    }

    static class abc146_b {
        public void solve(int testNumber, Scanner in, PrintWriter out) throws UnsupportedEncodingException {
            int N = in.nextInt();
            String S = in.next();
            byte[] asciiCodes;

            asciiCodes = S.getBytes("US-ASCII");

            for (int i = 0; i < asciiCodes.length; i++) {
                //System.out.println("asciiCodes[" + i + "]:" + asciiCodes[i]);
                asciiCodes[i] = (byte) (asciiCodes[i] + N <= 90 ? (asciiCodes[i] + N) : (65 + ((asciiCodes[i] + N) - 90) - 1));
                //System.out.println("asciiCodes[" + i + "]:" + asciiCodes[i]);
            }
            out.println(new String(asciiCodes, "US-ASCII"));
        }

    }
}



Compiler output:
Main.java:19: error: unreported exception UnsupportedEncodingException; must be caught or declared to be thrown
        solver.solve(1, in, out);
                    ^
1 error
Language: C

#include <stdio.h>
#include <string.h>
int main(void)
{
  int i=0,num,len;
  char str1[8],str2[12000];
  fgets(str1,sizeof(str1),stdin);
  sscanf(str1,"%d",&num);
  fgets(str2,sizeof(str2),stdin);
	len = strlen(str2);
  for(i=0;i<len;i++)
  {
    int x = str[i] - 'A';
    int add = (x+num)/26;
    printf("%c",add);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:13: error: 'str' undeclared (first use in this function); did you mean 'str2'?
   13 |     int x = str[i] - 'A';
      |             ^~~
      |             str2
main.c:13:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <string.h>
int main(void)
{
  int i=0,num,len;
  char str1[8],str2[12000];
  fgets(str1,sizeof(str1),stdin);
  sscanf(str1,"%d",&num);
  fgets(str2,sizeof(str2),stdin);
	len = strlen(str);
  for(i=0;i<len;i++)
  {
    int x = str[i] - 'A';
    int add = (x+num)/26;
    printf("%c",add);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:22: error: 'str' undeclared (first use in this function); did you mean 'str2'?
   10 |         len = strlen(str);
      |                      ^~~
      |                      str2
main.c:10:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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



int main() {
	string S;
	int A;
	cin >>A>> S;
	
	rep(0, S.size()) {

		if ((S.at(i) + A) > (int)'Z') {
			cout << (char)(('A' - 1) + (((int)S.at(i) + A) - 'Z'));
			continue;
		}
		cout << (char)(S.at(i) + A) <<;
		
	}
	cout << endl;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:47: error: expected primary-expression before ';' token
   20 |                 cout << (char)(S.at(i) + A) <<;
      |                                               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
  char buf[256], *p;
  int N;
  cin>>N;
  cin>>buf;
  for(p = buf; *p; p++) {
    *p += N;
  }
  printf buf;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: expected ';' before 'buf'
   11 |   printf buf;
      |         ^~~~
      |         ;