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

#include "../bits/stdc++.h"

#define X first
#define Y second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define rep(i, a, b) for (unsigned i = (a); i <= (b); ++i)
#define per(i, a, b) for (unsigned i = (a); i >= (b); --i)

using namespace std;

using I = int;
using L = long;
using F = float;
using S = string;
using C = char;
using LL = long long;
using VI = vector<int>;
using VL = vector<long>;
using VF = vector<float>;
using VS = vector<string>;
using PLL = pair<long, long>;
using PLF = pair<long, float>;
using PLS = pair<long, string>;
using PSL = pair<string, long>;
using PSF = pair<string, float>;
using PSS = pair<string, string>;
using MLL = map<long, long>;
using MLF = map<long, float>;
using MLS = map<long, string>;
using MSL = map<string, long>;
using MSF = map<string, float>;
using MSS = map<string, string>;

const long kMax2 = 109;
const long kMax3 = 1009;
const long kMax4 = 10009;
const long kMax5 = 100009;
const long kMax6 = 1000009;
const long kInfI = 0x3F3F3F3F;
const float kInfF = 1e15;

int main(int argc, char const *argv[]) {
  while (1) {
    L n, m;
    L ans1 = 0;
    L ans2 = 0;
    scanf("%ld", &n);
    getchar();
    if (n == 0) { break; }
    map<char, char> mp;
    for (unsigned i = 0; i < n; i++) {
      C a = getchar();
      getchar();
      C b = getchar();
      getchar();
      mp.emplace(a, b);
    }
    scanf("%ld\n", &m);
    for (unsigned i = 0; i < m; i++) {
      C c = getchar();
      getchar();
      if (mp.find(c) == mp.end()) {
        putchar(c);
      } else {
        putchar(mp[c]);
      }
    }
    printf("\n");
  }

  return 0;
}

Compiler output:
a.cc:1:10: fatal error: ../bits/stdc++.h: No such file or directory
    1 | #include "../bits/stdc++.h"
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

d = dict()
s = set()

while True:
    N = int(input())
    if N == 0:
        break

    res = ''

    for i in range(N):
        line = input()

        d[line[0]] = line[-1]

    M = int(input())

    for i in range(M):
        line = input()
        if line in d and line not in s:
            res += d[line]
            s.add(d[line])
        else:
            res += line

    print(res)



Compiler output:
a.cc:9:11: error: empty character constant
    9 |     res = ''
      |           ^~
a.cc:1:1: error: 'd' does not name a type
    1 | d = dict()
      | ^
Language: C++

#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <limits>
#include <sstream>

using namespace std;

int main (void)
{
	for (int k = 0; k < 5; k++)
	{
	long n,m;

	long char a[10000],b[10000],x[10000];

	cin >> n;
	if (n == 0)
	{
		break;
	}

	for (long i = 0; i < n; i++)
	{
		cin >> a[i] >> b[i];
	}
	cin >> m;

	for (long j = 0; j < m; j++)
	{
		cin >> x[j];
	}

	for (long j = 0; j < m; j++)
	{
		for (long i = 0; i < n; i++)
		{
			if (a[i] == x[j])
			{
				x[j] = b[i];
			}
		}
	}

	for (long j = 0; j < m; j++)
	{
		cout << x[j];
		if (j == m - 1)
		{
			cout << endl;
		}
	}
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'long' specified with 'char'
   19 |         long char a[10000],b[10000],x[10000];
      |         ^~~~
a.cc:19:9: error: 'long' specified with 'char'
a.cc:19:9: error: 'long' specified with 'char'
Language: C++

<?php
        for($loop_cnt = 0; $loop_cnt < 5; $loop_cnt++)
        {

                $data_set = array();
                $data = array();

                // 変換表数設定
                $input_n = trim(fgets(STDIN));
                if( 0 == $input_n)
                {
                        break;
                }

                // 変換表設定
                for($loop_n = 0; $loop_n < $input_n; $loop_n++)
                {
                        $input_conv = explode( " " , trim(fgets(STDIN)) );

                        $data_set = $data_set + array( $input_conv[0] => $input_conv[1]) ;
                }

                // データ数設定
                $input_m = trim(fgets(STDIN));

                // データ設定
                for($loop_m = 0; $loop_m < $input_m; $loop_m++)
                {
                        $input_data = trim(fgets(STDIN));
                        $data[$loop_m] = $input_data;
                }

                // 変換後出力
                $work = [];
                for($loop_m = 0; $loop_m < $input_m; $loop_m++)
                {
                        if( isset( $data_set[$data[$loop_m]] ) )

                        {
                                $work[] = $data_set[ $data[$loop_m] ];
                        }
                        else
                        {
                                $work[] = $data[$loop_m];
                        }
                }
                echo implode('' , $work);
                echo "\n";
        };
?>


Compiler output:
a.cc:47:30: error: empty character constant
   47 |                 echo implode('' , $work);
      |                              ^~
a.cc:1:1: error: expected unqualified-id before '<' token
    1 | <?php
      | ^
a.cc:2:28: error: '$loop_cnt' does not name a type
    2 |         for($loop_cnt = 0; $loop_cnt < 5; $loop_cnt++)
      |                            ^~~~~~~~~
a.cc:2:43: error: '$loop_cnt' does not name a type
    2 |         for($loop_cnt = 0; $loop_cnt < 5; $loop_cnt++)
      |                                           ^~~~~~~~~
a.cc:50:1: error: expected unqualified-id before '?' token
   50 | ?>
      | ^
Language: C++

#include <iostream>
using namespace std;
int main()
{
	int n,m;
	int henkan[256];
	while(cin>>n,n){
		memset(henkan,0,sizeof(henkan));
		while(n--){
			char a,b; cin>>a>>b;
			henkan[(int)a] = b;
		}
		cin>>m;
		while(m--){
			char a; cin>>a;
			printf("%c",henkan[(int)a]?:a);
		}
		puts("");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'memset' was not declared in this scope
    8 |                 memset(henkan,0,sizeof(henkan));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' 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 <stdio.h>
#include <string.h>

int main(void)
{
	char change[26 + 26 + 9];
	int n, m;
	
	while (1){
		memset(change, 0, sizeof(change));
		
		scanf("%d", &n);
		
		if (n == 0){
			break;
		}
		
		
		for (int i = 0; i < n; i++){
			char base[2], ca[2];
			
			scanf("%s%s", base, ca);
			
			change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')] = ca[0];
		}
		
		scanf("%d", &m);
		
		for (int i = 0; i < m; i++){
			char c[2];
			
			scanf("%s", c);
			
			if (change[isdigit(c[0]) ? (c[0] - '0') + 52 : isupper(c[0]) ? (c[0] - 'A') + 26 : (c[0] - 'a')] != 0){
				printf("%c", change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')]);
			}
			else {
				printf("%c", c);
			}
		}
		
		puts("");
	}
	
	return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:32: error: 'isdigit' was not declared in this scope
   24 |                         change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')] = ca[0];
      |                                ^~~~~~~
a.cc:24:74: error: 'isupper' was not declared in this scope
   24 |                         change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')] = ca[0];
      |                                                                          ^~~~~~~
a.cc:34:36: error: 'isdigit' was not declared in this scope
   34 |                         if (change[isdigit(c[0]) ? (c[0] - '0') + 52 : isupper(c[0]) ? (c[0] - 'A') + 26 : (c[0] - 'a')] != 0){
      |                                    ^~~~~~~
a.cc:34:72: error: 'isupper' was not declared in this scope
   34 |                         if (change[isdigit(c[0]) ? (c[0] - '0') + 52 : isupper(c[0]) ? (c[0] - 'A') + 26 : (c[0] - 'a')] != 0){
      |                                                                        ^~~~~~~
a.cc:35:61: error: 'base' was not declared in this scope
   35 |                                 printf("%c", change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')]);
      |                                                             ^~~~
Language: C++

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

int main(void)
{
	char change[26 + 26 + 9];
	int n, m;
	
	while (1){
		memset(change, 0, sizeof(change));
		
		scanf("%d", &n);
		
		if (n == 0){
			break;
		}
		
		
		for (int i = 0; i < n; i++){
			char base[2], ca[2];
			
			scanf("%s%s", base, ca);
			
			change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')] = ca[0];
		}
		
		scanf("%d", &m);
		
		for (int i = 0; i < m; i++){
			char c[2];
			
			scanf("%s", c);
			
			if (change[isdigit(c[0]) ? (c[0] - '0') + 52 : isupper(c[0]) ? (c[0] - 'A') + 26 : (c[0] - 'a')] != 0){
				printf("%c", change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')]);
			}
			else {
				printf("%c", c);
			}
		}
		
		puts("");
	}
	
	return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:61: error: 'base' was not declared in this scope
   36 |                                 printf("%c", change[isdigit(base[0]) ? (base[0] - '0') + 52 : isupper(base[0]) ? (base[0] - 'A') + 26 : (base[0] - 'a')]);
      |                                                             ^~~~
Language: C++

 #include<stdio.h>

int main(){
        int a,b;
        char aa[100],bb[100],d;
        scanf("%d",&a);
        for(int i=0;i<a;i++) scanf(" %c %c",&aa[i],&bb[i]);
        scanf("%d",&b);
        for(int i=0;i<b;i++)
        {
                scanf(" %c",&d);
                for(int j=0;j<a;j++){
                        if(d==aa[j])
                        {d=bb[j];
                        printf("%c\n",d);
                        break;
                        }
                }
                printf("%c",d);
        }
        printf("\n");
}
return 0;
}

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

 #include<stdio.h>

int main(){
 while(1){
        int a,b;
        char aa[100],bb[100],d,dd[100000000];
        scanf("%d",&a);
 if(a==0) break;
        for(int i=0;i<a;i++) scanf(" %c %c",&aa[i],&bb[i]);
        scanf("%d",&b);
        for(int i=0;i<b;i++)
        {
                scanf(" %c",&dd[i]);
                for(int j=0;j<a;j++){
                        if(dd[i]==aa[j])
                        {printf("%c",bb[j]);
                         break;
                        }
ツ　ツ　ツ　ツ　ツ　ツ　if(j==a) printf("%c",dd[i]);
               }
                printf("%c",dd[i]);
        }
        printf("\n");
}
return 0;
}

Compiler output:
a.cc:19:1: error: extended character 　 is not valid in an identifier
   19 | ツ　ツ　ツ　ツ　ツ　ツ　if(j==a) printf("%c",dd[i]);
      | ^
a.cc:19:1: error: extended character 　 is not valid in an identifier
a.cc:19:1: error: extended character 　 is not valid in an identifier
a.cc:19:1: error: extended character 　 is not valid in an identifier
a.cc:19:1: error: extended character 　 is not valid in an identifier
a.cc:19:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:19:1: error: '\U000030c4\U00003000\U000030c4\U00003000\U000030c4\U00003000\U000030c4\U00003000\U000030c4\U00003000\U000030c4\U00003000if' was not declared in this scope
   19 | ツ　ツ　ツ　ツ　ツ　ツ　if(j==a) printf("%c",dd[i]);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

 #include<stdio.h>

int main(){
 while(1){
        int a,b;
        char aa[100],bb[100],d,dd[100000000];
        scanf("%d",&a);
 if(a==0) break;
        for(int i=0;i<a;i++) scanf(" %c %c",&aa[i],&bb[i]);
        scanf("%d",&b);
        for(int i=0;i<b;i++)
        {
                scanf(" %c",&dd[i]);
                for(int j=0;j<a;j++){
                        if(dd[i]==aa[j])
                        {printf("%c",bb[j]);
                         break;
                        }
ツ　ツ　ツ　ツ　ツ　ツ　if(j==a) printf("%c",dd[i]);
               }
      }
        printf("\n");
}
return 0;
}

Compiler output:
a.cc:19:1: error: extended character 　 is not valid in an identifier
   19 | ツ　ツ　ツ　ツ　ツ　ツ　if(j==a) printf("%c",dd[i]);
      | ^
a.cc:19:1: error: extended character 　 is not valid in an identifier
a.cc:19:1: error: extended character 　 is not valid in an identifier
a.cc:19:1: error: extended character 　 is not valid in an identifier
a.cc:19:1: error: extended character 　 is not valid in an identifier
a.cc:19:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:19:1: error: '\U000030c4\U00003000\U000030c4\U00003000\U000030c4\U00003000\U000030c4\U00003000\U000030c4\U00003000\U000030c4\U00003000if' was not declared in this scope
   19 | ツ　ツ　ツ　ツ　ツ　ツ　if(j==a) printf("%c",dd[i]);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <map>

map<char, char> conv;

main() {
  int n, m;
  while((cin >> n) && n) {
    conv,clear();
    for(int i = 0; i < n; ++i) {
      char a, b;
      cin >> a >> b;
      conv[a] = b;
    }
    cin >> m;
    for(int i = 0; i < m; ++i) {
      char c;
      cin >> c;
      if(conv[c] == 0) cout << c;
      else             cout << conv[c];
    }
    cout << endl;
  }
}

Compiler output:
a.cc:4:1: error: 'map' does not name a type
    4 | map<char, char> conv;
      | ^~~
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   while((cin >> n) && n) {
      |          ^~~
      |          std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:5: error: 'conv' was not declared in this scope; did you mean 'lconv'?
    9 |     conv,clear();
      |     ^~~~
      |     lconv
a.cc:9:10: error: 'clear' was not declared in this scope
    9 |     conv,clear();
      |          ^~~~~
a.cc:19:24: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |       if(conv[c] == 0) cout << c;
      |                        ^~~~
      |                        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:20:24: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |       else             cout << conv[c];
      |                        ^~~~
      |                        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:22:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   22 |     cout << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:22:13: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   22 |     cout << endl;
      |             ^~~~
      |             std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<stdio.h>
#include<stdlib.h>

int main()
{
	char *before=NULL;
	char *after=NULL;
	char *str=NULL;
	char buf[11];
	char ch;
	int m,n,i,j,conv;

	while(1)
	{
		fgets(buf,11,stdin);
		n=atoi(buf);
		if(n==0)break;
		before=realloc(before,n*sizeof(char));
		after=realloc(after,n*sizeof(char));

		for(i=0;i<n;i++)
		{
			fgets(buf,5,stdin);
			*(before+i)=*buf;
			*(after+i)=*(buf+2);
		}

		
		fgets(buf,11,stdin);
		m=atoi(buf);
		str=realloc(str,(m+1)*sizeof(char));
		for(j=0;j<m;j++)
		{
			fgets(buf,3,stdin);
			ch=*buf;
			conv=0;
			for(i=0;i<n;i++)
			{
				if(ch==*(before+i))
				{
					*(str+j)=*(after+i);
					conv=1;
				}
			}
			if(conv==0){*(str+j)=ch;}
		}
		*(str+m)='\0';
		puts(str);
	}
	free(str);
	free(before);
	free(after);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:31: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
   18 |                 before=realloc(before,n*sizeof(char));
      |                        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
      |                               |
      |                               void*
a.cc:19:30: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
   19 |                 after=realloc(after,n*sizeof(char));
      |                       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
      |                              |
      |                              void*
a.cc:31:28: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
   31 |                 str=realloc(str,(m+1)*sizeof(char));
      |                     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
      |                            |
      |                            void*
Language: C++

#include <iostream>
#include <string>
using namespace std;
char s[100000000];
int main()
{
	int n, m, i, j, k;
	char a[80], b[80], c;
	bool f = false;
	while (cin >> n && n)
	{
		for (i = 0; i < n; i++)
		{
			cin >> a[i] >> b[i];
		}
		cin >> m;
		strcpy(s, "");
		for (i = k = 0; i < m; i++)
		{
			cin >> c;
			for (j = f = 0; j < n && !f; j++)
			{
				if (c == a[j])
				{
					s[i] = b[j];
					f = true;
				}
			}
			if (!f)
				s[i] = c;
		}
		s[m-1] = '\0';
		cout << s << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'strcpy' was not declared in this scope
   17 |                 strcpy(s, "");
      |                 ^~~~~~
a.cc:2:1: note: 'strcpy' 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>
#include <vector>

using namespace std;

int main(void) {
	for (int n = 0; (cin >> n) && n != 0;) {
		vector<pair<char, char>> conversion;
		for (int i = 0; i < n; i++) {
			char preLetter = 0, afterLetter = 0;
			cin >> preLetter >> afterLetter;
			conversion.push_back(make_pair<char,char>(preLetter, afterLetter));
		}
		int m = 0;
		cin >> m;
		vector<char> letters;
		for (int i = 0; i < m; i++) {
			char letter = 0;
			cin >> letter;
			letters.push_back(letter);
		}
		for (int i = 0; i < m; i++) {
			for (int j = 0; j < conversion.size(); j++) {
				if (conversion[j].first == letters[i]) {
					letters[i] = conversion[j].second;
					break;
				}
			}
			cout << letters[i];
		}
		cout << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:67: error: cannot bind rvalue reference of type 'char&&' to lvalue of type 'char'
   12 |                         conversion.push_back(make_pair<char,char>(preLetter, afterLetter));
      |                                                                   ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:1132:21: note:   initializing argument 1 of 'constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = char; _T2 = char; typename __strip_reference_wrapper<typename decay<_Tp>::type>::__type = char; typename decay<_Tp>::type = char; typename __strip_reference_wrapper<typename decay<_Tp2>::type>::__type = char; typename decay<_Tp2>::type = char]'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |               ~~~~~~^~~
Language: C++

using namespace std;


int main(){
	
	
	int a,b,c;
	int i,j,k;
	char arr[100000000][2];
	char arr2[100000000];
	
	
	while(1){
		
	
	cin >> a;
	if(a == 0 ) break;
	
	for(i=0 ;  i < a ; i++){
		
		cin >> arr[i][0] >> arr[i][1] ;
		
//		cout << a ;
		
	}
	
//	cout << "b";
	
//	cout << "bの入力"<<endl;
	
	cin >> b;
	
//	cout << "bの値は" << b << endl; 
	
	for(i=0 ; i<b ; i++){
		
//		cout << i << "周目" << endl;
		
		cin >> arr2[i];
		
		for(j=0 ;  j < a ; j++){
			
			if(arr2[i] == arr[j][0] ){
				 arr2[i] = arr[j][1];
				 break;
			}
		}
			
	}
	
	cout << arr2 << endl;
	
	}
	
	
	return 0;
	
}
	
	
		

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

#include <iostream>
#include <cstdio>

void Convert(std::string *target, std::string search, std::string to);

int main(){
        int n,m,i = 0;
        std::string table[10000][2];
        std::string String = "", q;
        while(1){
                scanf("%d", &n);
                if(n == 0)return 0;
                for(i = 0; i < n; ++i)std::cin >> table[i][0]  >> table[i][1];
                scanf("%d", &m);
                for(i = 0; i < m; ++i){
                        std::cin >> q;
                        String += q;
                }
                for(i = 0; i < n; ++i){
                        Convert(&String, table[i][0], table[i][1]);
                }
                std::cout << String << "\n";
        }

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

#include <iostream>
#include <cstdio>

void Convert(std::string *target, std::string search, std::string to);

int main(){
        int n,m,i = 0;
        std::string table[10000][2];
        std::string String = "", q;
        while(1){
                scanf("%d", &n);
                if(n == 0)return 0;
                for(i = 0; i < n; ++i)std::cin >> table[i][0]  >> table[i][1];
                scanf("%d", &m);
                for(i = 0; i < m; ++i){
                        std::cin >> q;
                        String += q;
                }
                for(i = 0; i < n; ++i){
                        Convert(&String, table[i][0], table[i][1]);
                }
                std::cout << String << "\n";
        }
}

Compiler output:
/usr/bin/ld: /tmp/ccj7VWxd.o: in function `main':
a.cc:(.text+0x222): undefined reference to `Convert(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
int n:
string a[n];
string b[n];

int c;
string d;
int m;
int e;
int f;
while(cin >> n){
if(n!=0){
c=0;
while(c<n){
cin >>a[c];
cin >>b[c];
c=c+1;}


cin >> m;
c=0;

while(c<m){
cin >>d;
e=0;
f=0;
while(e<n){
if(d==a[e]){cout<<b[e]; f=1;}
e=e+1;
}
if(f==0){cout <<d;}
c=c+1;}
}
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:6: error: found ':' in nested-name-specifier, expected '::'
    5 | int n:
      |      ^
      |      ::
a.cc:5:5: error: 'n' has not been declared
    5 | int n:
      |     ^
a.cc:6:8: error: qualified-id in declaration before 'a'
    6 | string a[n];
      |        ^
a.cc:7:10: error: 'n' was not declared in this scope
    7 | string b[n];
      |          ^
a.cc:18:7: error: 'a' was not declared in this scope
   18 | cin >>a[c];
      |       ^
a.cc:19:7: error: 'b' was not declared in this scope
   19 | cin >>b[c];
      |       ^
a.cc:31:7: error: 'a' was not declared in this scope
   31 | if(d==a[e]){cout<<b[e]; f=1;}
      |       ^
a.cc:31:19: error: 'b' was not declared in this scope
   31 | if(d==a[e]){cout<<b[e]; f=1;}
      |                   ^
Language: C++

#include <iostream>
using namespace std;

int main(){
        int n;
        cin >> n;
        do{
                char a[256],b[256];
                for(int i=0; i<n; i++){
                        cin >> a[i] >> b[i];
                }

                int num;
                cin >> num;
                char s[256];
                for(int i=0; i<num; i++){
                        cin >> s[i];
                        for(j=0; j<n; j++){
                                if(s[i]==a[j]){
                                        s[i]=b[j];
                                }
                        }
                }
                s[num]='\0';
                cin >> n;
        }while(n!=0);
}

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

#include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) cerr << #x << "=" << static_cast<bitset<16> >(x) << endl;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)
#define if_range(x, y, w, h) if (0<=x && x<w && 0<=y && y<h)

const int INF = 10000000;
int dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1};
using namespace std;
typedef pair<int, int> P;

/** Problem0501 : Data Conversion **/
int main()
{
	map<char, char> list;
	int n;
	while (cin>>n, n) {
		rep(k, n) {
			char from, to;
			cin>>from>>to;
			list[from]=to;
		}
		int m;
		cin>>m;
		rep(k, m) {
			char c;
			cin>>c;
			if (list.find(c) != list.end()) {
				cout<<list[c];
			} else {
				cout << c;
			}
		}
		cout << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'map' was not declared in this scope
   17 |         map<char, char> list;
      |         ^~~
a.cc:2:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    1 | #include <iostream>
  +++ |+#include <map>
    2 | 
a.cc:17:13: error: expected primary-expression before 'char'
   17 |         map<char, char> list;
      |             ^~~~
a.cc:23:25: error: 'list' was not declared in this scope
   23 |                         list[from]=to;
      |                         ^~~~
a.cc:2:1: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
    1 | #include <iostream>
  +++ |+#include <list>
    2 | 
a.cc:30:29: error: 'list' was not declared in this scope
   30 |                         if (list.find(c) != list.end()) {
      |                             ^~~~
a.cc:30:29: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
Language: Java

import java.io.*; // namespace...

class 0502 {
	
	public static void main() {
		
		System.out.printf("%d%n", solve());
		return;
	} 
	
	private int solve() {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferdReader br = new BufferedReader(isr);
		
		int ret = 1;
		String buf;
		
		int dtop=1, dforward=2, dside=3;
		
		
		while((buf = br.readLine()) != null) {
			int tmp;
			switch(buf) {
			case "North":
				tmp = dtop;
				dtop = dforward;
				dforward = 7-tmp;
				break;
			case "South":
				tmp = dtop;
				dtop = 7-dforward;
				dforward = tmp;
				break;
			case "West":
				tmp = dtop;
				dtop = dside;
				dside = 7-tmp;
				break;
			case "East":
				tmp = dtop;
				dtop = 7-dside;
				dside = tmp;
				break;
			case "Right":
				tmp = dforward;
				dforward = dside;
				dside = 7-tmp;
				break;
			case "Left":
				tmp = dforward;
				dforward = 7-dside;
				dside = tmp;
			}
			ret += dtop;
		}
		return ret;
	}
}

Compiler output:
Main.java:3: error: <identifier> expected
class 0502 {
     ^
1 error
Language: Java

import java.io.FileReader;
import java.io.BufferedReader;
import java.io.IOException;

public class Dice {
	
	int top, bottom, north, south, west, east;
	
	public Dice(){
		this.top = 1;
		this.bottom = 6;
		this.north = 5;
		this.south = 2;
		this.west = 4;
		this.east = 3;
	}
	
	public void initial(){
		this.top = 1;
		this.bottom = 6;
		this.north = 5;
		this.south = 2;
		this.west = 4;
		this.east = 3;
	}
}

public class Operation {
	public Dice before = new Dice();
	public Dice after = new Dice();
	
	
	public void read(){
		try {
			//ファイルを読み込む
			FileReader fr = new FileReader("test.txt");
			BufferedReader br = new BufferedReader(fr);

			//読み込んだファイルを１行ずつ画面出力する

			
			
			while(true){
				
				String line, st;
				int sum = 1;
				line = br.readLine();
				
				//System.out.println(line);
				
				if(Integer.parseInt(line) == 0) break;

				for(int i=0; i<Integer.parseInt(line); i++){

					st = br.readLine();
					
					if(st.equals("North")){
						after.north = before.top;
						after.top = before.south;
						after.south = before.bottom;
						after.bottom = before.north;
					}
					else if(st.equals("South")){
						after.north = before.bottom;
						after.top = before.north;
						after.south = before.top;
						after.bottom = before.south;
					}
					else if(st.equals("East")){
						after.west = before.bottom;
						after.top = before.west;
						after.east = before.top;
						after.bottom = before.east;
					}
					else if(st.equals("West")){
						after.west = before.top;
						after.top = before.east;
						after.east = before.bottom;
						after.bottom = before.west;
					}
					else if(st.equals("Right")){
						after.north = before.west;
						after.west = before.south;
						after.south = before.east;
						after.east = before.north;
					}
					else if(st.equals("Left")){
						after.north = before.east;
						after.west = before.north;
						after.south = before.west;
						after.east = before.south;
					}
					sum += after.top;
					//更新
					before.north = after.north;
					before.south = after.south;
					before.west = after.west;
					before.east = after.east;
					before.top = after.top;
					before.bottom = after.bottom;
				}
				System.out.println(sum);
				before.initial();
				after.initial();
			}
			//終了処理
			br.close();
			fr.close();

		} catch (IOException ex) {
			//例外発生時処理
			ex.printStackTrace();
		}
	}

	public static void main(String[] args){
		
		Operation op = new Operation();
		
		op.read();

	}

}

Compiler output:
Main.java:5: error: class Dice is public, should be declared in a file named Dice.java
public class Dice {
       ^
Main.java:28: error: class Operation is public, should be declared in a file named Operation.java
public class Operation {
       ^
2 errors
Language: Java

import java.io.FileReader;
import java.io.BufferedReader;
import java.io.IOException;


public class Operation {
	
	int before_north, before_south, before_west, before_east, before_top, before_bottom;
	int after_north, after_south, after_west, after_east, after_top, after_bottom;
	
	
	public void read(){
		try {
			//ファイルを読み込む
			FileReader fr = new FileReader("test.txt");
			BufferedReader br = new BufferedReader(fr);
			//読み込んだファイルを１行ずつ画面出力する
			while(true){
				initial();
				String line, st;
				int sum = 1;
				line = br.readLine();
				
				//System.out.println(line);
				
				if(Integer.parseInt(line) == 0) break;

				for(int i=0; i<Integer.parseInt(line); i++){

					st = br.readLine();
					
					if(st.equals("North")){
						after_north = before_top;
						after_top = before_south;
						after_south = before_bottom;
						after_bottom = before_north;
					}
					else if(st.equals("South")){
						after_north = before_bottom;
						after_top = before_north;
						after_south = before_top;
						after_bottom = before_south;
					}
					else if(st.equals("East")){
						after_west = before_bottom;
						after_top = before_west;
						after_east = before_top;
						after_bottom = before_east;
					}
					else if(st.equals("West")){
						after_west = before_top;
						after_top = before_east;
						after_east = before_bottom;
						after_bottom = before_west;
					}
					else if(st.equals("Right")){
						after_north = before_west;
						after_west = before_south;
						after_south = before_east;
						after_east = before_north;
					}
					else if(st.equals("Left")){
						after_north = before_east;
						after_west = before_north;
						after_south = before_west;
						after_east = before_south;
					}
					sum += after_top;
					//更新
					before_north = after_north;
					before_south = after_south;
					before_west = after_west;
					before_east = after_east;
					before_top = after_top;
					before_bottom = after_bottom;
				}
				System.out.println(sum);
			}
			//終了処理
			br.close();
			fr.close();

		} catch (IOException ex) {
			//例外発生時処理
			ex.printStackTrace();
		}
	}

	public void initial(){
		before_top = 1;
		before_bottom = 6;
		before_north = 5;
		before_south = 2;
		before_west = 4;
		before_east = 3;
		after_top = 1;
		after_bottom = 6;
		after_north = 5;
		after_south = 2;
		after_west = 4;
		after_east = 3;
	}
	
	public static void main(String[] args){
		Operation op = new Operation();
		op.read();
	}
}

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

import java.io.FileReader;
import java.io.BufferedReader;
import java.io.IOException;


public class Main {
	
	int before_north, before_south, before_west, before_east, before_top, before_bottom;
	int after_north, after_south, after_west, after_east, after_top, after_bottom;
	
	
	public void read(){
		try {
			//ファイルを読み込む
			FileReader fr = new FileReader("test.txt");
			BufferedReader br = new BufferedReader(fr);
			//読み込んだファイルを１行ずつ画面出力する
			while(true){
				initial();
				String line, st;
				int sum = 1;
				line = br.readLine();
				
				//System.out.println(line);
				
				if(Integer.parseInt(line) == 0) break;

				for(int i=0; i<Integer.parseInt(line); i++){

					st = br.readLine();
					
					if(st.equals("North")){
						after_north = before_top;
						after_top = before_south;
						after_south = before_bottom;
						after_bottom = before_north;
					}
					else if(st.equals("South")){
						after_north = before_bottom;
						after_top = before_north;
						after_south = before_top;
						after_bottom = before_south;
					}
					else if(st.equals("East")){
						after_west = before_bottom;
						after_top = before_west;
						after_east = before_top;
						after_bottom = before_east;
					}
					else if(st.equals("West")){
						after_west = before_top;
						after_top = before_east;
						after_east = before_bottom;
						after_bottom = before_west;
					}
					else if(st.equals("Right")){
						after_north = before_west;
						after_west = before_south;
						after_south = before_east;
						after_east = before_north;
					}
					else if(st.equals("Left")){
						after_north = before_east;
						after_west = before_north;
						after_south = before_west;
						after_east = before_south;
					}
					sum += after_top;
					//更新
					before_north = after_north;
					before_south = after_south;
					before_west = after_west;
					before_east = after_east;
					before_top = after_top;
					before_bottom = after_bottom;
				}
				System.out.println(sum);
			}
			//終了処理
			br.close();
			fr.close();

		} catch (IOException ex) {
			//例外発生時処理
			ex.printStackTrace();
		}
	}

	public void initial(){
		before_top = 1;
		before_bottom = 6;
		before_north = 5;
		before_south = 2;
		before_west = 4;
		before_east = 3;
		after_top = 1;
		after_bottom = 6;
		after_north = 5;
		after_south = 2;
		after_west = 4;
		after_east = 3;
	}
	
	public static void main(String[] args){
		Main op = new Operation();
		op.read();
	}
}

Compiler output:
Main.java:105: error: cannot find symbol
		Main op = new Operation();
		              ^
  symbol:   class Operation
  location: class Main
1 error
Language: Java

import java.util.Scanner;

public class Main {
	public static Scanner sc;
	public static void main(String[] args){
		sc=new Scanner(System.in);
		while(true){
			int n=sc.nextInt();
			if(n==0)break;
			Dice dice=new Dice();
			int ans=0;
			for(int i=0;i<n;i++){
				dice.roll(sc.next());
				ans+=dice.get(1);
			}
			System.out.println(ans);
		}
	}

}
class Dice {
	int d[]={1,2,3,4,5,6};

	void roll(String s){
		int temp=d[0];
		int temp2=d[1];
		switch(s) {
			case "North":
				d[0]=d[1];
				d[1]=d[5];
				d[5]=d[4];
				d[4]=temp;
				break;
			case "South":
				d[0]=d[4];
				d[4]=d[5];
				d[5]=d[1];
				d[1]=temp;
				break;
			case "East":
				d[0]=d[3];
				d[3]=d[5];
				d[5]=d[2];
				d[2]=temp;
				break;
			case "West":
				d[0]=d[2];
				d[2]=d[5];
				d[5]=d[3];
				d[3]=temp;
				break;
			case "Right":
				d[1]=d[2];
				d[2]=d[4];
				d[4]=d[3];
				d[3]=temp2;
			case "Left":
				d[1]=d[3];
				d[3]=d[4];
				d[4]=d[2];
				d[2]=temp2;
		}
	}
	int get(int i){
		return d[i-1];
	}

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

import java.util.*;
import java.lang.*;
import java.io.*;
 
public class answer{
    public static void main (String[] args) throws java.lang.Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        while(line!=null&&!"0".equals(line)){
            int cnt = Integer.parseInt(line);
            Dice dice = new Dice();
            for(int i=0;i<cnt;i++){
                line = br.readLine();
                dice.move(line);
            }
            System.out.println(dice.getAns());
            line = br.readLine();
        }
    }
     
    public static class Dice{
        int top,south,east,west,north,down;
        int topSum=1;
        Dice(){
            top=1;
            south=2;
            east=3;
            west=4;
            north=5;
            down=6;
        }
        public int getAns(){
            return topSum;
        }
        void move(String move){
            int tmp;
            if("North".equals(move)){
                tmp = top;
                top   = south;
                south = down;
                down  = north;
                north = tmp;
            }else if("East".equals(move)){
                tmp = top;
                top  = west;
                west = down;
                down = east;
                east = tmp;
            }else if("West".equals(move)){
                tmp = top;
                top  = east;
                east = down;
                down = west;
                west = tmp;
            }else if("South".equals(move)){
                tmp = top;
                top  = north;
                north = down;
                down = south;
                south = tmp;
            }else if("Right".equals(move)){
                tmp = south;
                south  = east;
                east = north;
                north = west;
                west = tmp;
            }else if("Left".equals(move)){
                tmp = south;
                south  = west;
                west = north;
                north = east;
                east = tmp;
            }
            topSum+=top;

        }
         
         
    }
}

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

public class Main {
	public static void main(String args[] ) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		int[] dice = {1, 2, 3, 4, 5, 6};
		List<Integer> resultList = new ArrayList<Integer>();
		while (true) {
			int n = sc.nextInt();
			if (n == 0) break; 
			
			int result = 0;
			for (int i = 0; i < n; i++) {
				String dist = sc.next();
				
				int tmp = 0;
				switch (dist) {
				case "North" :
					tmp = dice[0];
					dice[0] = dice[1];
					dice[1] = dice[5];
					dice[5] = dice[3];
					dice[3] = tmp;
					break;
				case "South" :
					tmp = dice[0];
					dice[0] = dice[3];
					dice[3] = dice[5];
					dice[5] = dice[1];
					dice[1] = tmp;
					break;
				case "East" :
					tmp = dice[0];
					dice[0] = dice[4];
					dice[4] = dice[5];
					dice[5] = dice[2];
					dice[2] = tmp;
					break;
				case "West" :
					tmp = dice[0];
					dice[0] = dice[2];
					dice[2] = dice[5];
					dice[5] = dice[4];
					dice[4] = tmp;
					break;
				case "Left" :
					tmp = dice[1];
					dice[1] = dice[4];
					dice[4] = dice[3];
					dice[3] = dice[2];
					dice[2] = tmp;
					break;
				case "Right" :
					tmp = dice[1];
					dice[1] = dice[2];
					dice[2] = dice[3];
					dice[3] = dice[4];
					dice[4] = tmp;
					break;
				default :
					break;
				}
				
				result += dice[0];
				System.out.println(result);
			}
			resultList.add(result);
		}
		
		for (int num : resultList) {
			System.out.println(num);
		}
	}
}

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
Main.java:6: error: cannot find symbol
		List<Integer> resultList = new ArrayList<Integer>();
		^
  symbol:   class List
  location: class Main
Main.java:6: error: cannot find symbol
		List<Integer> resultList = new ArrayList<Integer>();
		                               ^
  symbol:   class ArrayList
  location: class Main
4 errors
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Dice {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		boolean[] arg = null;
		int length=0,out=0;
        int i=0,rou=0,store=1;
        boolean first=true;
        List<Integer> score=new ArrayList<Integer>();
        int[] dice=new int[3];
        boolean[] rui=new boolean[3];

		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            while ((line = br.readLine()) != null ) {
            	if(line.equals("0")){
                	break;
                }
            	if(first){
            		length=Integer.parseInt(line);
            		for(int k=0;k<3;k++){
            			dice[k]=k+1;
            		}
            		first=false;
            	}else{
            		if(line.equals("North")){
            			int w=dice[0];
            			dice[0]=dice[1];
            			dice[1]=7-w;
            		}else if(line.equals("East")){
            			int w=dice[2];
            			dice[2]=dice[0];
            			dice[0]=7-w;
            		}else if(line.equals("West")){
            			int w=dice[0];
            			dice[0]=dice[2];
            			dice[2]=7-w;
            		}else if(line.equals("South")){
            			int w=dice[1];
            			dice[1]=dice[0];
            			dice[0]=7-w;
            		}else if(line.equals("Left")){
            			int w=dice[2];
            			dice[2]=dice[1];
            			dice[1]=7-w;
            		}else if(line.equals("Right")){
            			int w=dice[1];
            			dice[1]=dice[2];
            			dice[2]=7-w;
            		}
            		store+=dice[0];
            		i++;
            	}
            	if(length==i){
            		i=0;
            		rou++;
            		score.add(store);
            		store=1;
            		first=true;
            	}

            }
            for(int k=0;k<score.size();k++){
            	System.out.println(score.get(k));
            }
		}
	}

}

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

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		while(true){
			int count=0;
			int N = cin.nextInt();
			if(N==0){
				break;
			}
			Dice di = new Dice(1, 2);
			count += di.dice[0];
			for(int i = 0; i < N; i++){
				String str = cin.next();
				int dir = 0;
				if(str.equals("North")){
					dir = 3;
				}
				else if(str.equals("East")){
					dir = 2;
				}
				else if(str.equals("West")){
					dir = 4;
				}
				else if(str.equals("South")){
					dir = 1;
				}
				else if(str.equals("Right")){
					dir = 6;
				}
				else if(str.equals("Left")){
					dir =5 ;
				}
				di.dice = di.roll(dir);
				count += di.dice[0];
			}
			System.out.println(count);
		}

	}

}
class Dice {
	static int[] dice;
	static int[][] dice_table=
	{   {  0, 0, 0, 0, 0, 0, 0},
		{  0, 0, 3, 5, 2, 4, 0},
		{  0, 4, 0, 1, 6, 0, 3},
		{  0, 2, 6, 0, 0, 1, 5},
		{  0, 5, 1, 0, 0, 6, 2},
		{  0, 3, 0, 6, 1, 0, 4},
		{  0, 0, 4, 2, 5, 3, 0}
	
	};

	Dice(int x, int y){
		dice = new int[6];
		dice[0] = x;
		dice[1] = y;
		dice[2] = dice_table[x][y];
		dice[3] = 7-y;
		dice[4] = dice_table[y][x];
		dice[5] = 7-x;
	}
	static int[] turn(int dir){
		int[] b = new int[6];
		// Right
		if(dir == 5){
			b[0]=dice[0];
			b[1]=dice[4];
			b[2]=dice[1];
			b[3]=dice[2];
			b[4]=dice[3];
			b[5]=dice[5];
		}
		else{
			b[0]=dice[0];
			b[1]=dice[2];
			b[2]=dice[3];
			b[3]=dice[4];
			b[4]=dice[1];
			b[5]=dice[5];
		}
		return b;
	}
	static int[] roll(int dir){
		int[] b = new int[6];
		if(dir==1){
			b[0]=dice[3];
			b[1]=dice[0];
			b[2]=dice[2];
			b[3]=dice[5];
			b[4]=dice[4];
			b[5]=dice[1];
		}
		else if(dir==2){
			b[0]=dice[4];
			b[1]=dice[1];
			b[2]=dice[0];
			b[3]=dice[3];
			b[4]=dice[5];
			b[5]=dice[2];
		}
		else if(dir==3){
			b[0]=dice[1];
			b[1]=dice[5];
			b[2]=dice[2];
			b[3]=dice[0];
			b[4]=dice[4];
			b[5]=dice[3];
		}
		else if(dir==4){
			b[0]=dice[2];
			b[1]=dice[1];
			b[2]=dice[5];
			b[3]=dice[3];
			b[4]=dice[0];
			b[5]=dice[4];
		}
		else if(dir == 5){
			b[0]=dice[0];
			b[1]=dice[4];
			b[2]=dice[1];
			b[3]=dice[2];
			b[4]=dice[3];
			b[5]=dice[5];
		}
		else{
			b[0]=dice[0];
			b[1]=dice[2];
			b[2]=dice[3];
			b[3]=dice[4];
			b[4]=dice[1];
			b[5]=dice[5];
		}
		return b;
		
	}

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