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

#include<stdio.h>

int main(){

	int i,j,moji[100],sum;
	char tmp[100];

	while(fgets(tmp,100,stdin)!=NULL){
		sum=0;
		i=0;
		while(tmp[i]!=10){
			if(tmp[i]=='I') moji[i]=1;
			else if(tmp[i]=='V') moji[i]=5;
			else if(tmp[i]=='X') moji[i]=10;
			else if(tmp[i]=='L') moji[i]=50;
			else if(tmp[i]=='C') moji[i]=100;
			else if(tmp[i]=='D') moji[i]=500;
			else if(tmp[i]=='M') moji[i]=1000;
			i++;
		}
		i--;
		for(j=i;j!=0;j--){
			if(moji[j]>moji[j-1]){
				sum+=moji[j]-moji[j-1];
			}
			else if(moji[j]=<moji[j-1]){
				sum+=moji[j]+moji[j-1];
			}
		}
		printf("%d\n",sum);
	}







	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:26:41: error: expected expression before '<' token
   26 |                         else if(moji[j]=<moji[j-1]){
      |                                         ^
Language: C++

#include <cstdio>
#include <map>

using namespace std;

int main()
{
	map <string, int> list;
	
	list["I"] = 1;
	list["V"] = 5;
	list["X"] = 10;
	list["L"] = 50;
	list["C"] = 100;
	list["D"] = 500;
	list["M"] = 1000;
	list["N"] = 0;
		
	char s[10001];
	while(scanf("%s", s) != EOF){
		string str = s;
		string str_next = s;
		
		int len = str.size();
		int sum = 0;
		
		
		for(int i = 0; i < len; i++){
			str = s[i];
			str_next = s[i+1];
			
			if(list[str] < list[str_next]){
				sum += list[str_next] - list[str];
				i++;
			}
			
			else sum += list[str];
		}
		
		printf("%d\n", sum);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: 'string' was not declared in this scope
    8 |         map <string, int> list;
      |              ^~~~~~
a.cc:3:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    2 | #include <map>
  +++ |+#include <string>
    3 | 
a.cc:8:25: error: template argument 1 is invalid
    8 |         map <string, int> list;
      |                         ^
a.cc:8:25: error: template argument 3 is invalid
a.cc:8:25: error: template argument 4 is invalid
a.cc:10:19: error: assignment of read-only location '"I"[list]'
   10 |         list["I"] = 1;
      |         ~~~~~~~~~~^~~
a.cc:11:19: error: assignment of read-only location '"V"[list]'
   11 |         list["V"] = 5;
      |         ~~~~~~~~~~^~~
a.cc:12:19: error: assignment of read-only location '"X"[list]'
   12 |         list["X"] = 10;
      |         ~~~~~~~~~~^~~~
a.cc:13:19: error: assignment of read-only location '"L"[list]'
   13 |         list["L"] = 50;
      |         ~~~~~~~~~~^~~~
a.cc:14:19: error: assignment of read-only location '"C"[list]'
   14 |         list["C"] = 100;
      |         ~~~~~~~~~~^~~~~
a.cc:15:19: error: assignment of read-only location '"D"[list]'
   15 |         list["D"] = 500;
      |         ~~~~~~~~~~^~~~~
a.cc:16:19: error: assignment of read-only location '"M"[list]'
   16 |         list["M"] = 1000;
      |         ~~~~~~~~~~^~~~~~
a.cc:17:19: error: assignment of read-only location '"N"[list]'
   17 |         list["N"] = 0;
      |         ~~~~~~~~~~^~~
a.cc:21:23: error: expected ';' before 'str'
   21 |                 string str = s;
      |                       ^~~~
      |                       ;
a.cc:22:23: error: expected ';' before 'str_next'
   22 |                 string str_next = s;
      |                       ^~~~~~~~~
      |                       ;
a.cc:24:27: error: 'str' was not declared in this scope; did you mean 'std'?
   24 |                 int len = str.size();
      |                           ^~~
      |                           std
a.cc:30:25: error: 'str_next' was not declared in this scope
   30 |                         str_next = s[i+1];
      |                         ^~~~~~~~
Language: C++

#include <stdio.h>

char c[200];

int main(){
	int ans;
	int n;
	while(scanf("%s",&c) != EOF){
		n = strlen(c);
		ans = 0;
		for(int i = 0; i < n; i++){
			if(c[i] == 'I'){
				if(c[i + 1] == 'V' || c[i + 1] == 'X'){
					ans -= 1;
				}else{
					ans += 1;
				}
			}
			if(c[i] == 'X'){
				if(c[i + 1] == 'L' || c[i + 1] == 'C'){
					ans -= 10;
				}else{
					ans += 10;
				}
			}
			if(c[i] == 'C'){
				if(c[i + 1] == 'D' || c[i + 1] == 'M'){
					ans -= 100;
				}else{
					ans += 100;
				}
			}
			if(c[i] == 'V'){
				ans += 5;
			}
			if(c[i] == 'L'){
				ans += 50;
			}
			if(c[i] == 'D'){
				ans += 500;
			}
		}
		printf("%d\n",ans);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: 'strlen' was not declared in this scope
    9 |                 n = strlen(c);
      |                     ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <stdio.h>
  +++ |+#include <cstring>
    2 |
Language: C++

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

char c[200];

int main(){
	int ans;
	int n;
	while(scanf("%s",&c) != EOF){
		n = strlen(c);
		ans = 0;
		for(int i = 0; i < n; i++){
			if(c[i] == 'I'){
				if(c[i + 1] == 'V' || c[i + 1] == 'X'){
					ans -= 1;
				}else{
					ans += 1;
				}
			}
			if(c[i] == 'X'){
				if(c[i + 1] == 'L' || c[i + 1] == 'C'){
					ans -= 10;
				}else{
					ans += 10;
				}
			}
			if(c[i] == 'C'){
				if(c[i + 1] == 'D' || c[i + 1] == 'M'){
					ans -= 100;
				}else{
					ans += 100;
				}
			}
			if(c[i] == 'V'){
				ans += 5;
			}
			if(c[i] == 'L'){
				ans += 50;
			}
			if(c[i] == 'D'){
				ans += 500;
			}
		}
		printf("%d\n",ans);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: 'strlen' was not declared in this scope
   10 |                 n = strlen(c);
      |                     ^~~~~~
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<stdio.h>

int main(){
char ch,;
int sum;
int w,b,a;
sum=0;ch='\0';w=0;b=0;a=0;
while(scanf("%c",&ch)!=EOF){
while(1){
if(ch=='\0')break;
if(ch=='I')w=1;
else if(ch=='V')w=5;
else if(ch=='X')w=10;
else if(ch=='L')w=50;
else if(ch=='C)w=100;
else if(ch=='D')w=500;
else if(ch=='M')w=1000;
switch(w){
case 1:
a=1;break;
case 5:
if(b==1)a=4;else a=5;break;
case 10:
if(b==1)a=9;else a=10;break;
case 50:
if(b==10)a=40;else a=50;break;
case 100:
if(b==10)a=90;else a=100;break;
case 500:
if(b==100)a=400;else a=500;break;
case 1000:
if(b==100)a=9;else a=1000;break;
}
sum+=a;b=a;
}
printf( "%d\n",sum);
sum=0;ch='\0';w=0;b=0;a=0;
}
return 0;
}

Compiler output:
a.cc:15:13: warning: missing terminating ' character
   15 | else if(ch=='C)w=100;
      |             ^
a.cc:15:13: error: missing terminating ' character
   15 | else if(ch=='C)w=100;
      |             ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:4:9: error: expected unqualified-id before ';' token
    4 | char ch,;
      |         ^
a.cc:16:1: error: expected primary-expression before 'else'
   16 | else if(ch=='D')w=500;
      | ^~~~
a.cc:17:1: error: expected primary-expression before 'else'
   17 | else if(ch=='M')w=1000;
      | ^~~~
a.cc:16:23: error: expected ')' before 'else'
   16 | else if(ch=='D')w=500;
      |                       ^
      |                       )
   17 | else if(ch=='M')w=1000;
      | ~~~~                   
a.cc:15:8: note: to match this '('
   15 | else if(ch=='C)w=100;
      |        ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

void Solution()
{
    string str;
    
    int a;
    int b;
    int l;
    int x;
    
    char c;
    
    while (getline(cin, str)) //enter
    {
        x = 0;
        
        l = (int)str.size();
        
        for (int i　=　0; i　<　l; i++)
        {
            c = str.at(i); //string text = "ABCDEF";
                            //char ch = text.at( 2 );
            
                 if (c == 'I') a = 1;
            else if (c == 'V') a = 5;
            else if (c == 'X') a = 10;
            else if (c == 'L') a = 50;
            else if (c == 'C') a = 100;
            else if (c == 'D') a = 500;
            else if (c == 'M') a = 1000;
            
            if (i)
            {
                if (b >= a)
                {
                    x += b;
                }
                else
                {
                    x -= b;
                }
            }
            
            b = a;
        }
        
        x += b;
        
        cout << x << endl;
    }
    
}

int main()
{
    Solution()
    return 0;
}

Compiler output:
a.cc:23:18: error: extended character 　 is not valid in an identifier
   23 |         for (int i　=　0; i　<　l; i++)
      |                  ^
a.cc:23:22: error: extended character 　 is not valid in an identifier
   23 |         for (int i　=　0; i　<　l; i++)
      |                      ^
a.cc:23:27: error: extended character 　 is not valid in an identifier
   23 |         for (int i　=　0; i　<　l; i++)
      |                           ^
a.cc:23:31: error: extended character 　 is not valid in an identifier
   23 |         for (int i　=　0; i　<　l; i++)
      |                               ^
a.cc: In function 'void Solution()':
a.cc:23:22: error: '\U000030000' was not declared in this scope
   23 |         for (int i　=　0; i　<　l; i++)
      |                      ^~~
a.cc:23:31: error: '\U00003000l' was not declared in this scope
   23 |         for (int i　=　0; i　<　l; i++)
      |                               ^~~
a.cc:23:36: error: 'i' was not declared in this scope
   23 |         for (int i　=　0; i　<　l; i++)
      |                                    ^
a.cc: In function 'int main()':
a.cc:60:15: error: expected ';' before 'return'
   60 |     Solution()
      |               ^
      |               ;
   61 |     return 0;
      |     ~~~~~~
Language: C++

import java.util.Scanner;

//Roman Figure
public class AOJ0039 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			char[] s = sc.next().toCharArray();
			int sum = 0;
			int i;
			for(i=0;i<s.length-1;i++){
				if(f(s[i])>=f(s[i+1]))sum+=f(s[i]);
				else{
					sum += f(s[i+1])-f(s[i]);
					i++;
				}
			}
			if(i<s.length)sum += f(s[i]);
			System.out.println(sum);
		}
	}
	
	public static int f(char c){
		return c=='I'?1:
			c=='V'?5:
			c=='X'?10:
			c=='L'?50:
			c=='C'?100:
			c=='D'?500:1000;
	}
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	while(cin>>s){
		int b[2][100000]={0};bool bb[2][100000]={0};
		for(int i=0;i<100000;i++)for(j=0;j<2;j++)b[j][i]=0;
		for(int i=0;i<100000;i++)for(j=0;j<2;j++)bb[j][i]=0;
		int a[200],sum=0;
	    for(int i=0;i<200;i++)a[i]=0;
		for(int i=0;i<s.size();i++){
			int t;
			if(s[i]=='I')t=1;
			if(s[i]=='V')t=5;
			if(s[i]=='X')t=10;
			if(s[i]=='L')t=50;
			if(s[i]=='C')t=100;
			if(s[i]=='D')t=500;
			if(s[i]=='M')t=1000;
			a[i]=t;
			if(i&&a[i]!=a[i-1]&&b[0][a[i]])b[1][t]++;
			else b[0][t]++;
		}
		for(int i=s.size()-1;i>=0;i--){
			if(sum<a[i]){
				if(i!=s.size()-1&&a[i]!=a[i+1]&&bb[0][a[i]]){
					sum-=b[1][a[i]]*a[i];
				    i-=b[1][a[i]]-1;
				}
				else{sum+=b[0][a[i]]*a[i];
				i-=b[0][a[i]]-1;bb[0][a[i]]=1;}
			}		
			else{
				sum-=b[0][a[i]]*a[i];
				    i-=b[0][a[i]]-1;
				    bb[0][a[i]]=1;
			}
		}
		cout<<sum<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:46: error: 'j' was not declared in this scope
    7 |                 for(int i=0;i<100000;i++)for(j=0;j<2;j++)b[j][i]=0;
      |                                              ^
a.cc:8:46: error: 'j' was not declared in this scope
    8 |                 for(int i=0;i<100000;i++)for(j=0;j<2;j++)bb[j][i]=0;
      |                                              ^
Language: C++

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

int get_arabic(char x){
  if(x=='I')return 1;
  else if(x=='V')return 5;
  else if(x=='X')return 10;
  else if(x=='L')return 50;
  else if(x=='C')return 100;
  else if(x=='D')return 500;
  else if(x=='M')return 1000;
}

int roma_to_arabic(string roma){
  int nums[100];
  for(int i=0;i<roma.length();i++){
    nums[i]=get_arabic(roma[i]);
  }
  for(int i=0;i<roma.length();i+=2){
    if(nums[i]>=nums[i+1])nums[i]=nums[i]+nums[i+1];
    else if(nums[i]<nums[i+1])nums[i]=nums[i+1]-nums[i];
  }

  int retu=0;
  for(int i=0;i<roma.length();i+=2){
    retu+=nums[i];
  }
  return retu;
}
int main(){
  vector<int> answers;
  string roma_num;
  while(cin>>roma_num){
    answers.push_back(roma_to_arabic(roma_num));
  }
  for(int i=0;i<answers.size();i++){
    cout<<ansers[i]<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:11: error: 'ansers' was not declared in this scope; did you mean 'answers'?
   39 |     cout<<ansers[i]<<endl;
      |           ^~~~~~
      |           answers
a.cc: In function 'int get_arabic(char)':
a.cc:14:1: warning: control reaches end of non-void function [-Wreturn-type]
   14 | }
      | ^
Language: C++

#include <iostream>
#include <queue>
using namespace std;
??
??
int check(char c){
????if(c == 'I') return 1;
????else if(c == 'V') return 5;
????else if(c == 'X') return 10;
????else if(c == 'L') return 50;
????else if(c == 'C') return 100;
????else if(c == 'D') return 500;
????else if(c == 'M') return 1000;
}
??
int main(void){
????string str;
????while(cin >> str){
????????int ans = 0;
????????for(int i = 0; i < str.size() - 1; i++){
????????????if(check(str[i]) >= check(str[i+1])) ans += check(str[i]);
????????????else ans -= check(str[i]);
????????}
????????ans += check(str[str.size() - 1]);
????????cout << ans << endl;
????}
????return 0;
}

Compiler output:
a.cc:4:1: error: expected unqualified-id before '?' token
    4 | ??
      | ^
a.cc:15:1: error: expected unqualified-id before '?' token
   15 | ??
      | ^
Language: C++

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

int main(void){
  char s[104];
	int alpha[256];

	alpha['\0'] = 0;
	alpha['I'] = 1;
	alpha['V'] = 5;
	alpha['X'] = 10;
	alpha['L'] = 50;
	alpha['C'] = 100;
	alpha['D'] = 500;
	alpha['M'] = 1000;

	while(scanf("%s",s) != EOF){
		int sum = 0;
		int len = strlen(s);

		for(int i=0;i<len;i++){
			if(alpha[s[i]] >= alpha[s[i+1]]){
				sum += alpha[s[i]];
			}
			else{
				sum -= alpha[s[i]];
			}
		}
		cout<<sum<<endl;
	}

  return 0;
}

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

#include <iostream>
using namespace std;

int main()
{
	int a,m,i;
	int n[256];
	n['I']=1;
	n['V']=5;
	n['X']=10;
	n['L']=50;
	n['C']=100;
	n['D']=500;
	n['M']=1000;

	char s[128];
	while(cin >> s)
	{
		for(a=m=0,i=strlen(s)-1; i>=0; i--)
		{
			if(n[s[i]]<m)	{ a-=n[s[i]]; }
			else			{ a+=m=n[s[i]]; }
		}
		cout << a << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:29: error: 'strlen' was not declared in this scope
   19 |                 for(a=m=0,i=strlen(s)-1; i>=0; i--)
      |                             ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

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

int main()
{
	int a,m,i;
	int n[256];
	n['I']=1;
	n['V']=5;
	n['X']=10;
	n['L']=50;
	n['C']=100;
	n['D']=500;
	n['M']=1000;

	char s[128];
	while(cin >> s)
	{
		for(a=m=0,i=strlen(s)-1; i>=0; i--)
		{
			if(n[s[i]]<m)	{ a-=n[s[i]]; }
			else			{ a+=m=n[s[i]]; }
		}
		cout << a << endl;
	}
}

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

int main() {
  int a[10], b, c, n;
  bool judge;
 
  cin >> n;
  REP(i, n) {
    REP(j, 10) cin >> a[j];
    b = 0;
    c = 0;
    judge = true;
    REP(j, 10) {
      if(a[j] < b && a[j] < c) {
    judge = false;
    break;
      }
      else if(b < a[j] && c < a[j]) {
    if(b > c) b = a[j];
    else c = a[j];
      }
      else if(b < a[j] && c > a[j]) b = a[j];
      else if(b > a[j] && c < a[j]) c = a[j];
      else {
    if(b > c) b = a[j];
    else c = a[j];
      }
    }
    if(judge) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> n;
      |   ^~~
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   REP(i, n) {
      |       ^
a.cc:6:3: error: 'REP' was not declared in this scope
    6 |   REP(i, n) {
      |   ^~~
Language: Java

import java.io.*:
import java.util.ArrayList;
import java.util.HashMap;

class Main{
public static void main(String[] args) throws IOException{
final static int[] alphas={3,5,7,9,11,15,17,19,21,23,25};
final static int[] beta={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
line=br.readLine();
int n=Integer.parseInt(line);
for(int i=0;i<n;i++){
int ga;
int gb;
line=br.readLine();
String[] str=line.split(" ");
char[] chararray=line.toCarArray();
ArrayList<String> array=new ArrayList<String>();
HashMap<Character,Character> dic=new HashMap<Character,Character>();
for(String s : str){
if(s.length()==4){
array.add(s);
}
}
int[] uc=new int[4]
loop1: for(String ss : array){
       for(int p=0;p<4;p++){
       uc[p]=ss.charAt(p);
       }
       for(int a=0;a<alphas.length;a++){
       for(int b=0;b<beta.length;b++){
       char ct=(alphas[a]*('t'-97)+beta[b])%26+97;
       char ch=(alphas[a]*('h'-97)+beta[b])%26+97;
       char ci=(alphas[a]*('i'-97)+beta[b])%26+97;
       char cs=(alphas[a]*('s'-97)+beta[b])%26+97;
       char ca=beta[b]%26+97;
       if((uc[0]==ct&&uc[1]==ch&&uc[2]==ci&&uc[3]==cs)||(uc[0]==ct&&uc[1]==ch&&uc[2]==ca&&uc[3]==ct)){
       ga=alphas[a];
       gb=beta[b];
       break loop1;
       }
       }
       }
       }
for(int i=0;i<26;i++){
char nc=(ga*i+gb)%26+97;
char c=i+97;
dic.put(nc,c);
}
for(char cc : chararray){
if(cc>='a'&&cc<='z'){
cc=dic.get(cc);
}
}
System.out.println(chararray);
}
}
}

Compiler output:
Main.java:1: error: ';' expected
import java.io.*:
                ^
Main.java:26: error: ';' expected
int[] uc=new int[4]
                   ^
2 errors
Language: Java

import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;

class Main{
public static void main(String[] args) throws IOException{
final int[] alphas={3,5,7,9,11,15,17,19,21,23,25};
final int[] beta={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
line=br.readLine();
int n=Integer.parseInt(line);
for(int i=0;i<n;i++){
int ga;
int gb;
line=br.readLine();
String[] str=line.split(" ");
char[] chararray=line.toCarArray();
ArrayList<String> array=new ArrayList<String>();
HashMap<Character,Character> dic=new HashMap<Character,Character>();
for(String s : str){
if(s.length()==4){
array.add(s);
}
}
int[] uc=new int[4];
loop1: for(String ss : array){
       for(int p=0;p<4;p++){
       uc[p]=ss.charAt(p);
       }
       for(int a=0;a<alphas.length;a++){
       for(int b=0;b<beta.length;b++){
       char ct=(char)((alphas[a]*('t'-97)+beta[b])%26+97);
       char ch=(char)((alphas[a]*('h'-97)+beta[b])%26+97);
       char ci=(char)((alphas[a]*('i'-97)+beta[b])%26+97);
       char cs=(char)((alphas[a]*('s'-97)+beta[b])%26+97);
       char ca=(char)(beta[b]%26+97;
       if((uc[0]==ct&&uc[1]==ch&&uc[2]==ci&&uc[3]==cs)||(uc[0]==ct&&uc[1]==ch&&uc[2]==ca&&uc[3]==ct)){
       ga=alphas[a];
       gb=beta[b];
       break loop1;
       }
       }
       }
       }
for(int i=0;i<26;i++){
char nc=(char)((ga*i+gb)%26+97);
char c=(char)(i+97);
dic.put(nc,c);
}
for(char cc : chararray){
if(cc>='a'&&cc<='z'){
cc=dic.get(cc);
}
}
System.out.println(chararray);
}
}
}

Compiler output:
Main.java:37: error: ')' expected
       char ca=(char)(beta[b]%26+97;
                                   ^
1 error
Language: Java

import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;

class Main{
public static void main(String[] args) throws IOException{
final int[] alphas={3,5,7,9,11,15,17,19,21,23,25};
final int[] beta={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
line=br.readLine();
int n=Integer.parseInt(line);
for(int i=0;i<n;i++){
int ga;
int gb;
line=br.readLine();
String[] str=line.split(" ");
char[] chararray=line.toCarArray();
ArrayList<String> array=new ArrayList<String>();
HashMap<Character,Character> dic=new HashMap<Character,Character>();
for(String s : str){
if(s.length()==4){
array.add(s);
}
}
int[] uc=new int[4];
loop1: for(String ss : array){
       for(int p=0;p<4;p++){
       uc[p]=ss.charAt(p);
       }
       for(int a=0;a<alphas.length;a++){
       for(int b=0;b<beta.length;b++){
       char ct=(char)((alphas[a]*('t'-97)+beta[b])%26+97);
       char ch=(char)((alphas[a]*('h'-97)+beta[b])%26+97);
       char ci=(char)((alphas[a]*('i'-97)+beta[b])%26+97);
       char cs=(char)((alphas[a]*('s'-97)+beta[b])%26+97);
       char ca=(char)(beta[b]%26+97);
       if((uc[0]==ct&&uc[1]==ch&&uc[2]==ci&&uc[3]==cs)||(uc[0]==ct&&uc[1]==ch&&uc[2]==ca&&uc[3]==ct)){
       ga=alphas[a];
       gb=beta[b];
       break loop1;
       }
       }
       }
       }
for(int i=0;i<26;i++){
char nc=(char)((ga*i+gb)%26+97);
char c=(char)(i+97);
dic.put(nc,c);
}
for(char cc : chararray){
if(cc>='a'&&cc<='z'){
cc=dic.get(cc);
}
}
System.out.println(chararray);
}
}
}

Compiler output:
Main.java:18: error: cannot find symbol
char[] chararray=line.toCarArray();
                     ^
  symbol:   method toCarArray()
  location: variable line of type String
Main.java:46: error: variable i is already defined in method main(String[])
for(int i=0;i<26;i++){
        ^
2 errors
Language: Java

import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;

class Main{
public static void main(String[] args) throws IOException{
final int[] alphas={3,5,7,9,11,15,17,19,21,23,25};
final int[] beta={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
line=br.readLine();
int n=Integer.parseInt(line);
for(int i=0;i<n;i++){
int ga;
int gb;
line=br.readLine();
String[] str=line.split(" ");
char[] chararray=line.toCharArray();
ArrayList<String> array=new ArrayList<String>();
HashMap<Character,Character> dic=new HashMap<Character,Character>();
for(String s : str){
if(s.length()==4){
array.add(s);
}
}
int[] uc=new int[4];
loop1: for(String ss : array){
       for(int p=0;p<4;p++){
       uc[p]=ss.charAt(p);
       }
       for(int a=0;a<alphas.length;a++){
       for(int b=0;b<beta.length;b++){
       char ct=(char)((alphas[a]*('t'-97)+beta[b])%26+97);
       char ch=(char)((alphas[a]*('h'-97)+beta[b])%26+97);
       char ci=(char)((alphas[a]*('i'-97)+beta[b])%26+97);
       char cs=(char)((alphas[a]*('s'-97)+beta[b])%26+97);
       char ca=(char)(beta[b]%26+97);
       if((uc[0]==ct&&uc[1]==ch&&uc[2]==ci&&uc[3]==cs)||(uc[0]==ct&&uc[1]==ch&&uc[2]==ca&&uc[3]==ct)){
       ga=alphas[a];
       gb=beta[b];
       break loop1;
       }
       }
       }
       }
for(int j=0;j<26;j++){
char nc=(char)((ga*j+gb)%26+97);
char c=(char)(j+97);
dic.put(nc,c);
}
for(char cc : chararray){
if(cc>='a'&&cc<='z'){
cc=dic.get(cc);
}
}
System.out.println(chararray);
}
}
}

Compiler output:
Main.java:47: error: variable ga might not have been initialized
char nc=(char)((ga*j+gb)%26+97);
                ^
Main.java:47: error: variable gb might not have been initialized
char nc=(char)((ga*j+gb)%26+97);
                     ^
2 errors
Language: Java

import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;

class Main{
public static void main(String[] args) throws IOException{
final int[] alphas={1,3,5,7,9,11,15,17,19,21,23,25};
final int[] beta={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
int n=Integer.parseInt(br.readLine());
for(int i=0;i<n;i++){
int ga=0;
int gb=0;
line=br.readLine();
String[] str=line.split(" ");
char[] chararray=line.toCharArray();
ArrayList<String> array=new ArrayList<String>();
HashMap<Character,Character> dic=new HashMap<Character,Character>();
for(String s : str){
if(s.length()==4){
array.add(s);
}
}
char[] uc=new char[4];
loop1: for(String ss : array){
       for(int p=0;p<4;p++){
       uc[p]=ss.charAt(p);
       }
       for(int a=0;a<alphas.length;a++){
       for(int b=0;b<beta.length;b++){
       char ct=(char)((alphas[a]*('t'-97)+beta[b])%26+97);
       char ch=(char)((alphas[a]*('h'-97)+beta[b])%26+97);
       char ci=(char)((alphas[a]*('i'-97)+beta[b])%26+97);
       char cs=(char)((alphas[a]*('s'-97)+beta[b])%26+97);
       char ca=(char)(beta[b]%26+97);
       if(uc[0]==ct&&uc[1]==ch){
       if((uc[2]==ci&&uc[3]==cs)||(uc[2]==ca&&uc[3]==ct)){
       ga=alphas[a];
       gb=beta[b];
       break loop1;
       }
       }
       }
       }
for(int j=0;j<26;j++){
char nc=(char)((ga*j+gb)%26+97);
char c=(char)(j+97);
dic.put(nc,c);
}
for(char cc : chararray){
if(cc>='a'&&cc<='z'){
cc=dic.get(cc);
}
}
System.out.println(chararray);
}
}
}

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

import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;

class Main{
public static void main(String[] args) throws IOException{
final int[] alphas={1,3,5,7,9,11,15,17,19,21,23,25};
final int[] beta={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> array=new ArrayList<String>();
HashMap<Character,Character> dic=new HashMap<Character,Character>();
int ga;
int gb;
String line;
int n=Integer.parseInt(br.readLine());
while(n-->0){
line=br.readLine();
char[] chararray=line.toCharArray();
for(String s : line.split(" ")){
if(s.length()==4){
array.add(s);
}
}
outside: for(int p=0;p<array.size();p++){
         char[] uc=array.get(p).toCharArray();
         for(int a=0;a<alphas.length;a++){
         for(int b=0;b<beta.length;b++){
         char ct=(char)((alphas[a]*('t'-97)+beta[b])%26+97);
         char ch=(char)((alphas[a]*('h'-97)+beta[b])%26+97);
         char ci=(char)((alphas[a]*('i'-97)+beta[b])%26+97);
         char cs=(char)((alphas[a]*('s'-97)+beta[b])%26+97);
         char ca=(char)((alphas[a]*('a'-97)+beta[b])%26+97);
         if(uc[0]==ct&&uc[1]==ch){
         if((uc[2]==ci&&uc[3]==cs)||(uc[2]==ca&&uc[3]==ct)){
         ga=alphas[a];
         gb=beta[b];
         break outside;
         }
         }
         }
         }
         }
for(int j=0;j<26;j++){
char nc=(char)((ga*j+gb)%26+97);
char c=(char)(j+97);
dic.put(nc,c);
}
for(char cc: chararray){
if(cc>='a'&&cc<='z'){
cc=dic.get(cc);
}
}
System.out.println(chararray);
}
array.clear();
dic.clear();
}
}

Compiler output:
Main.java:44: error: variable ga might not have been initialized
char nc=(char)((ga*j+gb)%26+97);
                ^
Main.java:44: error: variable gb might not have been initialized
char nc=(char)((ga*j+gb)%26+97);
                     ^
2 errors
Language: Java

import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;

class Main{
public static void main(String[] args) throws IOException{
final int[] alphas={1,3,5,7,9,11,15,17,19,21,23,25};
final int[] beta={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> array=new ArrayList<String>();
HashMap<Character,Character> dic=new HashMap<Character,Character>();
int ga=null;
int gb=null;
String line;
int n=Integer.parseInt(br.readLine());
while(n-->0){
line=br.readLine();
char[] chararray=line.toCharArray();
for(String s : line.split(" ")){
if(s.length()==4){
array.add(s);
}
}
outside: for(int p=0;p<array.size();p++){
         char[] uc=array.get(p).toCharArray();
         for(int a=0;a<alphas.length;a++){
         for(int b=0;b<beta.length;b++){
         char ct=(char)((alphas[a]*('t'-97)+beta[b])%26+97);
         char ch=(char)((alphas[a]*('h'-97)+beta[b])%26+97);
         char ci=(char)((alphas[a]*('i'-97)+beta[b])%26+97);
         char cs=(char)((alphas[a]*('s'-97)+beta[b])%26+97);
         char ca=(char)((alphas[a]*('a'-97)+beta[b])%26+97);
         if(uc[0]==ct&&uc[1]==ch){
         if((uc[2]==ci&&uc[3]==cs)||(uc[2]==ca&&uc[3]==ct)){
         ga=alphas[a];
         gb=beta[b];
         break outside;
         }
         }
         }
         }
         }
for(int j=0;j<26;j++){
char nc=(char)((ga*j+gb)%26+97);
char c=(char)(j+97);
dic.put(nc,c);
}
for(char cc: chararray){
if(cc>='a'&&cc<='z'){
cc=dic.get(cc);
}
}
System.out.println(chararray);
}
array.clear();
dic.clear();
}
}

Compiler output:
Main.java:12: error: incompatible types: <null> cannot be converted to int
int ga=null;
       ^
Main.java:13: error: incompatible types: <null> cannot be converted to int
int gb=null;
       ^
2 errors
Language: Java

import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;

class Main{
public static void main(String[] args) throws IOException{
final int[] alphas={1,3,5,7,9,11,15,17,19,21,23,25};
final int[] beta={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> array=new ArrayList<String>();
HashMap<Character,Character> dic=new HashMap<Character,Character>();
int ga;
int gb;
String line;
int n=Integer.parseInt(br.readLine());
while(n-->0){
ga=o;
gb=0;
line=br.readLine();
char[] chararray=line.toCharArray();
for(String s : line.split(" ")){
if(s.length()==4){
array.add(s);
}
}
outside: while(true){
         for(int p=0;p<array.size();p++){
         char[] uc=array.get(p).toCharArray();
         for(int a=0;a<alphas.length;a++){
         for(int b=0;b<beta.length;b++){
         char ct=(char)((alphas[a]*('t'-97)+beta[b])%26+97);
         char ch=(char)((alphas[a]*('h'-97)+beta[b])%26+97);
         char ci=(char)((alphas[a]*('i'-97)+beta[b])%26+97);
         char cs=(char)((alphas[a]*('s'-97)+beta[b])%26+97);
         char ca=(char)((alphas[a]*('a'-97)+beta[b])%26+97);
         if(uc[0]==ct&&uc[1]==ch){
         if((uc[2]==ci&&uc[3]==cs)||(uc[2]==ca&&uc[3]==ct)){
         ga=alphas[a];
         gb=beta[b];
         break outside;
         }
         }
         }
         }
         }
         }
for(int j=0;j<26;j++){
char nc=(char)((ga*j+gb)%26+97);
char c=(char)(j+97);
dic.put(nc,c);
}
for(char cc: chararray){
if(cc>='a'&&cc<='z'){
cc=dic.get(cc);
}
}
System.out.println(String.valueOf(chararray));
}
array.clear();
dic.clear();
}
}

Compiler output:
Main.java:17: error: cannot find symbol
ga=o;
   ^
  symbol:   variable o
  location: class Main
1 error
Language: Java

import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
 
class Main{
public static void main(String[] args) throws IOException{
final int[] alphas={1,3,5,7,9,11,15,17,19,21,23,25};
final int[] betas={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> array=new ArrayList<String>();
HashMap<Character,Character> dic=new HashMap<Character,Character>();
int ga;
int gb;
String line;
int n=Integer.parseInt(br.readLine());
while(n-->0){
ga=0;
gb=0;
line=br.readLine();
char[] chararray=line.toCharArray();
for(String s : line.split(" ")){
if(s.length()==4){
array.add(s);
}
}
outside: for(int p=0;p<array.size();p++){
         char[] uc=array.get(p).toCharArray();
         for(int a=0;a<alphas.length;a++){
         for(int b=0;b<betas.length;b++){
         char ct=(char)((alphas[a]*('t'-97)+beta[b])%26+97);
         char ch=(char)((alphas[a]*('h'-97)+beta[b])%26+97);
         char ci=(char)((alphas[a]*('i'-97)+beta[b])%26+97);
         char cs=(char)((alphas[a]*('s'-97)+beta[b])%26+97);
         char ca=(char)((+beta[b])%26+97);
         if(uc[0]==ct&&uc[1]==ch){
         if((uc[2]==ci&&uc[3]==cs)||(uc[2]==ca&&uc[3]==ct)){
         ga=alphas[a];
         gb=beta[b];
         break outside;
         }
         }
         }
         }
         }
for(int i=0;i<26;i++){
char nc=(char)((ga*i+gb)%26+97);
char c=(char)(i+97);
dic.put(nc,c);
}
for(int i=0;i<chararray.length;i++){
if(chararray[i]>='a'&&chararray[i]<='z'){
chararray[i]=dic.get(chararray[i]);
}
}
System.out.println(chararray);
array.clear();
dic.clear();
}
}
}

Compiler output:
Main.java:30: error: cannot find symbol
         char ct=(char)((alphas[a]*('t'-97)+beta[b])%26+97);
                                            ^
  symbol:   variable beta
  location: class Main
Main.java:31: error: cannot find symbol
         char ch=(char)((alphas[a]*('h'-97)+beta[b])%26+97);
                                            ^
  symbol:   variable beta
  location: class Main
Main.java:32: error: cannot find symbol
         char ci=(char)((alphas[a]*('i'-97)+beta[b])%26+97);
                                            ^
  symbol:   variable beta
  location: class Main
Main.java:33: error: cannot find symbol
         char cs=(char)((alphas[a]*('s'-97)+beta[b])%26+97);
                                            ^
  symbol:   variable beta
  location: class Main
Main.java:34: error: cannot find symbol
         char ca=(char)((+beta[b])%26+97);
                          ^
  symbol:   variable beta
  location: class Main
Main.java:38: error: cannot find symbol
         gb=beta[b];
            ^
  symbol:   variable beta
  location: class Main
6 errors
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class AffineCipher {
	public static void main(String[] args) throws IOException {
		BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		for ( ; n > 0 ; n--) {
			String cipher = br.readLine();
			System.out.println(decrypt(cipher));
		}
	}

	public static String decrypt(String cipher) {
		char[] cipherdata = cipher.toCharArray();
		char[] decryptdata = new char[cipherdata.length];
		for (int a = 0; a < 26; a++) {
			if (a % 2 == 0 || a % 13 == 0) continue;
			for (int b = 0; b < 26; b++) {
				for (int i=0; i < cipherdata.length; i++) {
					if (cipherdata[i] == ' ') {
						decryptdata[i] = ' ';
					} else {
						decryptdata[i] =
								f_inverse(cipherdata[i], a, b);
					}
				}
				String decryption = String.valueOf(decryptdata);
				if (decryption.indexOf("that") != -1
						|| decryption.indexOf("this") != -1) {
					return decryption;
				}
			}
		}
		return "hoge";
	}

	private static char f_inverse(char y, int a, int b) {
//		y = f(x) = (a * x + b) % 26;
		y = (char) (y - 'a');
		char x;
		for (x = 0; x < 26; x++) {
			int fx = (a * x + b) % 26;
			if (y == fx) break;
		}
		return (char) (x + 'a');
	}
}

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

#include<stdio.h>
char str[258];
int space[257];
int main() {
	int s, N;
	int a, b, i, j;
	char n[4];
	int ax[12] = {1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25};
	fgets(str,  288, stdin);
	for (i = 0; str[i] != '\n'; i ++);
	i --; j = 1; N = 0;
	for (;i > -1; i --) {
		N += (str[i] - '0') * j;
		j *= 10;
	}
	for (s = 0; s < N; s ++) {
		str = {}
		fgets(str, 258, stdin);
		j = 0;
		for (i = 0; str[i] != '\n'; i ++) {
			if (str[i] == ' ') {
				space[j] = i;
				j ++;
			}
		}
		space[++ j] = i;
		space[++ j] = -1;
		b = 52;
		for (a = 0; a < 12; a ++) {
			for (i = 0; space[i] != -1; i ++) {
				if (space[i + 1] - space[i] - 1 == 4) {
					for (j = 0; j < 4; j ++) n[j] = (str[space[i] + j + 1] - 'a') * ax[a] % 26 + 'a';
					if (n[1] - n[0] == 'h' - 't' &&
					((n[2] - n[1] == 'i' - 'h' && n[3] - n[2] == 's' - 'i') || 
					(n[2] - n[1] == 'a' - 'h' && n[3] - n[2] == 't' - 'a'))) {
						b = 't' - n[0] + 26;
						break;
					}
				}
			}
			if (b == 't' - n[0] + 26) break;
		}
		for (i = 0; str[i] != '\n'; i ++) if ('a' <= str[i] && str[i] <= 'z') str[i] = ((str[i] - 'a') * ax[a] + b) % 26 + 'a';
		printf("%s", str);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:23: error: expected expression before '{' token
   17 |                 str = {}
      |                       ^
Language: C

#include<stdio.h>
#include<string.h>
int main(int argc, const char * argv[]){
    char s[257],t[257];
    int i,j,k,n,l;
    
    scanf("%d\n",&n);
    for(l=0;l<n;l++){
        gets(s);
        for(i=1;i<=26;i+=2)
            for(j=0;j<=26;j++){
                for(k=0,strcpy(t,s);s[k];k++)
                    if(s[k]>='a'&&s[k]<='z')
                        t[k]=((s[k]-'a')*i+j)%26+'a';
                if(strstr(t,"this")||strstr(t,"that"))
                    puts(t);
            }
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    9 |         gets(s);
      |         ^~~~
      |         fgets
Language: C

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

int main(int argc, const char * argv[]){
    char s[257],t[257];
    int i,j,k,n,l;
    
    scanf("%d\n",&n);
    for(l=0;l<n;l++){
        gets(s);
        for(i=1;i<=26;i+=2){
            for(j=0;j<=26;j++){
                for(k=0,strcpy(t,s);s[k];k++)
                    if(s[k]>='a'&&s[k]<='z')
                        t[k]=((s[k]-'a')*i+j)%26+'a';
                if(strstr(t,"this")||strstr(t,"that"))
                    puts(t);
            }
        }
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   10 |         gets(s);
      |         ^~~~
      |         fgets
Language: C

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

int main(int argc, const char * argv[]){
    char s[257],t[257];
    int i,j,k,n,l;
    
    scanf("%d",&n);
    for(l=0;l<n;l++){
        gets(s);
        for(i=1;i<=26;i+=2){
            for(j=0;j<=26;j++){
                for(k=0,strcpy(t,s);s[k];k++)
                    if(s[k]>='a'&&s[k]<='z')
                        t[k]=((s[k]-'a')*i+j)%26+'a';
                if(strstr(t,"this")||strstr(t,"that"))
                    puts(t);
            }
        }
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   10 |         gets(s);
      |         ^~~~
      |         fgets
Language: C

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

int main(int argc, const char * argv[]){
    char s[257],t[257];
    int i,j,k,n,l;
    
    scanf("%d",&n);
    for(l=0;l<n+1;l++){
        gets(s);
        for(i=1;i<=26;i+=2){
            for(j=0;j<=26;j++){
                for(k=0,strcpy(t,s);s[k];k++)
                    if(s[k]>='a'&&s[k]<='z')
                        t[k]=((s[k]-'a')*i+j)%26+'a';
                if(strstr(t,"this")||strstr(t,"that"))
                    puts(t);
            }
        }
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   10 |         gets(s);
      |         ^~~~
      |         fgets
Language: C

/*
AizuOnline A0040
Affine Cipher
*/
#include <stdio.h>
#include <string.h>

unsigned char ango[257];
unsigned char ango2[257];
#define AZ_dif ('Z'-'A'+1) 
#define DELIM " .\n"
int alpha,beta;

int devmod(char x,char y,int m)
{
  int i,s,r;
  //printf("xym %d %d \n",x,y);
  for(i=0,s=x;i<m;i++,s+=m)
    if(((s % y)==0))
      {
	r=s/y;
	if(r<0)r+=m;
	//printf("dm%d %d %d\n",x,y,s/y);
	return(r);
      }
  return(0);
}

int calc_alpha(char c1,char c2,char c3,char c4)
{
  //printf("CA %c %c %c %c\n",c1,c2,c3,c4);
return(devmod(c1-c2,c3-c4, AZ_dif));
}


  
main()
{
  int i;
  char *p;
  int a1,a2,a3,a21,a31;
  int n;
  int loop;

  scanf("%d ",&n);
  for(loop=0;loop<n;loop++)
    {
      //printf("gyo=%d\n",n);
      fgets(ango,256,stdin);
	
      strcpy(ango2,ango);
      beta=-99;
      
      p=strtok(ango2,DELIM);
      do
	{
	  if(strlen(p)!=4)
	    continue;
	  a1=calc_alpha(p[0],p[2],'t','i'); 
	  a2=calc_alpha(p[2],p[1],'i','h');
	  //a3=calc_alpha(p[2],p[3],'i','s');
	  a21=calc_alpha(p[1],p[2],'h','a');
	  a31=calc_alpha(p[3],p[2],'t','a');
	  //printf("a:%d %d %d %d\n",a1,a2,a21,a31);
	
	  if(a1==a2 && !isloewer(p[4])) 
	    {
	      alpha=a1;
	      if((alpha % 2)==0 ||(alpha % 13)==0)
	      continue;
	    beta= ((p[0]-'a')-('t'-'a')*alpha) % AZ_dif;
	    if(beta < 0)beta+=AZ_dif;
	    break;
	      }
	    else if(a21==a31 && !isalpha(p[4])) 
	      {
		alpha=a21;
		if((alpha % 2)==0 ||(alpha % 13)==0)
		  continue;
		beta= ((p[0]-'a')-('t'-'a')*alpha) % AZ_dif;
		if(beta < 0)beta+=AZ_dif;
		break;
	      }
      }  while(p=strtok(NULL,DELIM));
#ifdef DEBUG      
      printf("ab %d %d\n",alpha,beta);
#endif      
      if(beta != -99)
	{
	  for(i=0;ango[i];i++)
	    if(isalpha(ango[i]))
	      {
		ango[i] -= 'a';
		ango[i] -= beta;
		    ango[i] = devmod(ango[i],alpha,AZ_dif);
		    ango[i] += 'a';
	      }
	  printf("%s",ango);
	  //printf("%d\n",devmod(255,alpha,AZ_dif));
	}
    }
  return(0);
}

Compiler output:
main.c:37:1: error: return type defaults to 'int' [-Wimplicit-int]
   37 | main()
      | ^~~~
main.c: In function 'main':
main.c:66:25: error: implicit declaration of function 'isloewer' [-Wimplicit-function-declaration]
   66 |           if(a1==a2 && !isloewer(p[4]))
      |                         ^~~~~~~~
main.c:75:34: error: implicit declaration of function 'isalpha' [-Wimplicit-function-declaration]
   75 |             else if(a21==a31 && !isalpha(p[4]))
      |                                  ^~~~~~~
main.c:7:1: note: include '<ctype.h>' or provide a declaration of 'isalpha'
    6 | #include <string.h>
  +++ |+#include <ctype.h>
    7 |
Language: C

#include"test.h"

int main()
{
	char s[257],t[257];
	init();
	for(int i=0;i<10;i++)
	{
		int a=rand()%10000,b=rand()%10000;
		gets(s);
		strcpy(t,s);
		for(int j=0,k=strlen(s);j<k;j++)
			if(isalnum(s[j]))
				t[j]=(a*(s[j]-'a')+b)%26+'a';
		printf("%d %d\n",a,b);
		puts(t);
	}
	return 0;
}

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

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cctype>
#include<cstdlib>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
    int n;
    cin>>n;
    string str;
    getline(cin.str);
    while(n--){
        getline(cin,str);
        bool f=false;
        for(int a=1;!f;a++){
            if(a%2==0||a%13==0)continue;
            for(int b=0;!f&&b<26;b++){
                char m[26];
                for(int i=0;i<26;i++)m[(i*a+b)%26]=i+'a';
                string t=str;
                for(int i=0;i<t.size();i++){
                    if(islower(t[i]))t[i]=m[t[i]-'a'];
                }
                bool f_this=(t.find("this")!=string::npos);
                bool f_that=(t.find("that")!=string::npos);
                if(f_this||f_that){
                    str=t;
                    f=true;
                }
            }
        }
        cout<<str<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'std::istream' {aka 'class std::basic_istream<char>'} has no member named 'str'
   14 |     getline(cin.str);
      |                 ^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
#include <cstdio>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define pb(a) push_back(a)
int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

int main(void){
  int num;
  cin>>num;
  cin.ignore();
  rep(i,num){
    string s,ss;
    getline(cin,s);
    bool flag = true;
    ss = s;
    rep(i,26){
      rep(j,26){
	if(ss.find("that") == string::npos & ss.find("this") == string::npos){
	  rep(k,s.size()){
	    ss=((((s[i]-'a')*x)+y)%26)+'a';
	    
	  }
	    
	}else{
	  cout<<ss<<endl;
	  flag = false;
	  break;
	}
      }
      if(!flag){
	break;
      }
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:30: error: 'x' was not declared in this scope
   37 |             ss=((((s[i]-'a')*x)+y)%26)+'a';
      |                              ^
a.cc:37:33: error: 'y' was not declared in this scope
   37 |             ss=((((s[i]-'a')*x)+y)%26)+'a';
      |                                 ^
Language: C++

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

int main(){
    int n=10;
    cin>>n;
    string str;
    n++;
    while(n--){
        getline(cin,str);
        for(int i=3;i<99;i++){
            if(i%2==0||i%13==0)continue;
            for(int j=0;j<26;j++){
                vector<int>vec;
                for(int k=0;k<26;k++){
                    vec.push_back((i*k+j)%26);
                }
                sort(vec.begin(),vec.end());
                if(unique(vec.begin(), vec.end())!=vec.end())continue;
                string ss=str;
                for(int k=0;k<str.length();k++){
                    if(str[k]>='a'&&str[k]<='z')
                        ss[k]=((i*(str[k]-'a')+j)%26)+'a';
                    else ss[k]=str[k];
                }
                int len=ss.length();
                for(int k=0;k<len-3;k++){
                    if(ss.substr(k,4)=="this"||ss.substr(k,4)=="that"){
                        cout<<ss<<endl;
                        goto next;
                    }
                }
            }
        }
    next:;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   20 |                 sort(vec.begin(),vec.end());
      |                 ^~~~
      |                 short
a.cc:21:20: error: 'unique' was not declared in this scope
   21 |                 if(unique(vec.begin(), vec.end())!=vec.end())continue;
      |                    ^~~~~~