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

import java.util.Scanner;

public class J0084{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			String word = sc.next();
			int n = word.length();
			
			//System.out.println("n=" + n);
			
			if(word.charAt(n-1) == ',' || word.charAt(n-1) == '.') {
				n--;
			}
		
			if(n>=3 && n<=6) {
				System.out.print(word.substring(0,n) + " ");
			}
				
		}
	
		System.out.println();
	
	}
}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:3:1: error: unknown type name 'public'
    3 | public class J0084{
      | ^~~~~~
main.c:3:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'J0084'
    3 | public class J0084{
      |              ^~~~~
Language: C

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			String word = sc.next();
			int n = word.length();
			
			//System.out.println("n=" + n);
			
			if(word.charAt(n-1) == ',' || word.charAt(n-1) == '.') {
				n--;
			}
		
			if(n>=3 && n<=6) {
				System.out.print(word.substring(0,n) + " ");
			}
				
		}
	
		System.out.println();
	
	}
}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:3:1: error: unknown type name 'public'
    3 | public class Main{
      | ^~~~~~
main.c:3:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    3 | public class Main{
      |              ^~~~
Language: C

#include<stdio.h>
#include<string.h>
	void aaa(int m,int i,char *a){
		int g;
		if(3<=m&&6>=m){
				for(g=i-m;g<i;g++)
					printf("%c",a[g]);
		putchar(' ');	}
			
}
	int main(){
		char a[2000];
		int h,i,m=0;
		gets(a);
		h=strlen(a);
		for(i=0;i<h;i++){
			if(a[i]=='.'||a[i]==','||a[i]==' '){
				if(m>0){
					aaa(m,i,a);
					m=0;
				}
			}
			else m++;
		}
		return 0;
}

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

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

int getNextWord(int added, char* src, char* word)
{
	int i;
	for( i = 0; src[i] != ' ' && src[i] != '.' && src[i] != ',' && src[i] != '\0'; i++ )
	{
		word[i] = src[i];
	}
	word[i] = '\0';
	
	for(; src[i] == ' ' || src[i] == '.' || src[i] == ',' || src[i] == '\0'; i++ )
	{
	}
	
	return (i + added);
}

int main(void)
{
	char string[2048] = {0};
	char word[2048] = {0};
	int i;
	int len;
	
	fgets( string, 2048, stdin );
	
	string[ strlen( string ) ] = '\0';
	
	for( i = 0; i < 2048; )
	{
		i = getNextWord( i, string + i, word );
		len = strlen( word );
		if( len >= 3 && len <= 6 )
		{
			printf("%s ", word);
		}
	}
	puts("");
	
	return (0);
}

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

#include<stdio.h>
#include<iostream>
#include<string>
using namespace std;

int main(){
string st;
bool f=false;
while(cin>>st){
int t=st.size();
if(t<=6&&t>=3){
if(f==true)cout<<" ";
cout<<st;f=false;
}
return 0;
}

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

import sys

line = raw_input()
word_list = line.translate(None, '.,').split()
ans = []
for word in word_list:
    if len(word) >= 3 and len(word) <= 6:
        ans.append(word)

for i, w in enumerate(ans):
    if i != 0:
        sys.stdout.write(" ")
    sys.stdout.write(w)
sys.stdout.write("\n")

Compiler output:
a.cc:4:34: warning: multi-character character constant [-Wmultichar]
    4 | word_list = line.translate(None, '.,').split()
      |                                  ^~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

char s[2000];
vector<string>ans;

int main() {
	gets_s(s);
	char*split;
	split = strtok(s, " ,.");
	do {
		if (3 <= strlen(split) && strlen(split) <= 6)
			ans.push_back(string(split));
	} while (split = strtok(NULL, " ,."), split);
	rep(i, ans.size()) {
		cout << ans[i] << (i == ans.size() - 1 ? '\n' : ' ');
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'gets_s' was not declared in this scope; did you mean 'getsid'?
   10 |         gets_s(s);
      |         ^~~~~~
      |         getsid
Language: C++

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

vector<string> split(const string& input, char delimiter)
{
  istringstream stream(input);

  string field;
  vector<string> result;
  while (getline(stream, field, delimiter)) {
    result.push_back(field);
  }
  return result;
}

int main() {
  string str;
  int i = 0;

  getline(cin, str);
  replace(str.begin(), str.end(), '.', ' ');
  replace(str.begin(), str.end(), ',', ' ');

  for (const string& s : split(str, ' ')) {
    int size = str.size();
    if(size > 2 && size < 7) {
      cout << s << ' ' << endl;
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:3: error: 'replace' was not declared in this scope
   24 |   replace(str.begin(), str.end(), '.', ' ');
      |   ^~~~~~~
Language: C++

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

vector<string> split(const string& input, char delimiter)
{
  istringstream stream(input);

  string field;
  vector<string> result;
  while (getline(stream, field, delimiter)) {
    result.push_back(field);
  }
  return result;
}

int main() {
  string str;
  int i = 0;

  getline(cin, str);
  replace(str.begin(), str.end(), '.' | ',', ' ');
  //replace(str.begin(), str.end(), ',', ' ');

  for (const string& s : split(str, ' ')) {
    int size = s.size();
    if(size > 2 && size < 7) {
      cout << s << ' ';
    }
  }
  cout << endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:25:10: error: no matching function for call to 'replace(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, int, char)'
   25 |   replace(str.begin(), str.end(), '.' | ',', ' ');
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_algo.h:4280:5: note: candidate: 'template<class _FIter, class _Tp> void std::replace(_FIter, _FIter, const _Tp&, const _Tp&)'
 4280 |     replace(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4280:5: note:   template argument deduction/substitution failed:
a.cc:25:10: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'char')
   25 |   replace(str.begin(), str.end(), '.' | ',', ' ');
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:174:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::replace(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&, const _Tp&)'
  174 | replace(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value,
      | ^~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:174:1: note:   candidate expects 5 arguments, 4 provided
Language: C++

#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
using namespace std;
/*
vector<string> split(const string& input, char delimiter)
{
  istringstream stream(input);

  string field;
  vector<string> result;
  while (getline(stream, field, delimiter)) {
    result.push_back(field);
  }
  return result;
}
*/
int main() {
  string str, word;
  int i = 0;

  getline(cin, str);
  while(str[i] != '\0'){
    if(str[i] == '.' || str[i] == ',')
      str[i] = ' ';
    i++;
  }

/*
  for (const string& s : split(str, ' ')) {
    int size = s.size();
    if(size > 2 && size < 7) {
      cout << s << ' ';
    }
  }
 */
    
  stringstream ss(str);
    
  while (ss >> word) {
    int len = word.length();
      if(len>=3&&len<=6){
        if(i==0){cout<<word;i++;}
        else    cout<<' '<<word;
    }
  }
    
  cout << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:11: error: 'cin' was not declared in this scope
   23 |   getline(cin, str);
      |           ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include <algorithm>
  +++ |+#include <iostream>
    5 | using namespace std;
a.cc:44:18: error: 'cout' was not declared in this scope
   44 |         if(i==0){cout<<word;i++;}
      |                  ^~~~
a.cc:44:18: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:45:17: error: 'cout' was not declared in this scope
   45 |         else    cout<<' '<<word;
      |                 ^~~~
a.cc:45:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:49:3: error: 'cout' was not declared in this scope
   49 |   cout << endl;
      |   ^~~~
a.cc:49:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
using namespace std;
/*
vector<string> split(const string& input, char delimiter)
{
  istringstream stream(input);

  string field;
  vector<string> result;
  while (getline(stream, field, delimiter)) {
    result.push_back(field);
  }
  return result;
}
*/
int main() {
  string str, word;
  int i = 0;

  getline(cin, str);
  while(str[i] != '\0'){
    if(str[i] == '.' || str[i] == ',')
      str[i] = ' ';
    i++;
  }

/*
  for (const string& s : split(str, ' ')) {
    int size = s.size();
    if(size > 2 && size < 7) {
      cout << s << ' ';
    }
  }
 */
    
  stringstream ss(str);
  
  i=0
  while (ss >> word) {
    int len = word.length();
      if(len>=3&&len<=6){
        if(i==0){cout<<word;i++;}
        else    cout<<' '<<word;
    }
  }
    
  cout << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:6: error: expected ';' before 'while'
   42 |   i=0
      |      ^
      |      ;
   43 |   while (ss >> word) {
      |   ~~~~~
Language: C++

#include<iostream>
int main(){
  std::string l[1000];
  int c=0,k;
  while(std::cin>>l[c]) {
    if((l[c].find(","))+(l[c].find("."))!=-2)
      l[c].replace(l[c].length()-1,1,"");
    if( (l[c].length()>2)&&(l[c].length()<7))
      c++;
  }
  for(k=0;k<c;k++) {
    std::cout<<l[k];
    if(k!=c-1) std::cout<<" ";
  std::cout<<"\n";
}

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

#include<iostream>
#include<string>
#include<algorithm>
#include<functional>
#include<cctype>
using namespace std;
struct IsAlpha:unary_function<char, bool>
{bool operator()(char c)const{return isalpha(c)||c=='\'';}};
int main()
{
	string s;
	getline(cin, s);
	string::iterator i1=s.begin(),i2;
	ostream_iterator<char>o(cout);
	int f=0;
	for(;;)
	{
		i2 = find_if(i1,s.end(),not1(IsAlpha()));
		if(i2==s.end()){*o='\n';break;}
		if(i2-i1>2&&i2-i1<7)
			(f++?(*o=' ',f):f),
			copy(i1,i2,o);
		i1=i2+1;
	}
	return 0;
}

Compiler output:
a.cc:7:16: warning: 'template<class _Arg, class _Result> struct std::unary_function' is deprecated [-Wdeprecated-declarations]
    7 | struct IsAlpha:unary_function<char, bool>
      |                ^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:49,
                 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_function.h:117:12: note: declared here
  117 |     struct unary_function
      |            ^~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:14:9: error: 'ostream_iterator' was not declared in this scope
   14 |         ostream_iterator<char>o(cout);
      |         ^~~~~~~~~~~~~~~~
a.cc:6:1: note: 'std::ostream_iterator' is defined in header '<iterator>'; this is probably fixable by adding '#include <iterator>'
    5 | #include<cctype>
  +++ |+#include <iterator>
    6 | using namespace std;
a.cc:14:26: error: expected primary-expression before 'char'
   14 |         ostream_iterator<char>o(cout);
      |                          ^~~~
a.cc:18:45: warning: 'constexpr std::unary_negate<_Predicate> std::not1(const _Predicate&) [with _Predicate = IsAlpha]' is deprecated: use 'std::not_fn' instead [-Wdeprecated-declarations]
   18 |                 i2 = find_if(i1,s.end(),not1(IsAlpha()));
      |                                         ~~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_function.h:1043:5: note: declared here
 1043 |     not1(const _Predicate& __pred)
      |     ^~~~
a.cc:19:34: error: 'o' was not declared in this scope
   19 |                 if(i2==s.end()){*o='\n';break;}
      |                                  ^
a.cc:21:32: error: 'o' was not declared in this scope
   21 |                         (f++?(*o=' ',f):f),
      |                                ^
Language: C++

#include<iostream>
#include<string>
#include<ctype>
#include<vector>
using namespace std;
int main(){
	int x,now;
	string s;
	vector<string> box;
	getline(cin,s);
		now=0;
		for(int i=0;i<s.size();i++){
			if(s[i]!=' '&&s[i]!='.'&&s[i]!=','){
				now++;
			}
			else{
				if(now>=3&&now<=6)
				box.push_back(s.substr(i-now,now));
				now=0;
			}
		}
		for(int i=0;i<box.size();i++){
			cout<<box[i];
			cout<<(box.size()-1!=i?' ':'\n');
		}
	return 0;
}

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

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <cctype>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

char buf[1030];

inline bool ok(char c) {
  return c != ',' && c != ' ' && c != '.' ;
}

int main() {
  while (gets(buf)) {
    const int N = strlen(buf);
    size_t itr = 0, cnt = 0;
    if (ok(buf[0])) {
      cnt = 1;
    } else {
      itr = 1;
    }
    for (int i = 1; i < N; ++i) {
      if (ok(buf[i])) {
        ++cnt;
      } else {
        if (cnt > 2 && cnt < 7) {
          for (int j = itr; j < i; ++j) putchar(buf[j]);
        }
        itr = i;
        cnt = 0;
      }
    }
    puts("");
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:10: error: 'gets' was not declared in this scope; did you mean 'getw'?
   29 |   while (gets(buf)) {
      |          ^~~~
      |          getw
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
int main(){
	string str;
	getline(cin,str);
	str += " ";
    string word[1024];
    int j = 0;
    for(int i = 0; i < str.size(); i++){
        if(str[i] == '.' || str[i] == ',' || str[i] == ' ')j++;
        else word[j] += str[i];
    }
    for(int i = 0; i < j; i++){
        if(word[i].size() > 2 && word[i].size() < 7){
            cout << word[i];
            printf("%c",i==j-1?'\n':' ');
        }
    }
	return 0;
}


Win today's preliminary contest and be qualified to visit University of Aizu.

Compiler output:
a.cc:27:10: warning: missing terminating ' character
   27 | Win today's preliminary contest and be qualified to visit University of Aizu.
      |          ^
a.cc:27:10: error: missing terminating ' character
   27 | Win today's preliminary contest and be qualified to visit University of Aizu.
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:27:1: error: 'Win' does not name a type
   27 | Win today's preliminary contest and be qualified to visit University of Aizu.
      | ^~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
	string in, out;
	bool flg = false;
	getline(cin, in);

	replace(in.begin(), in.end(), ',', ' ');
	replace(in.begin(), in.end(), '.', ' ');
	
	cout<<in.size()<<endl;
	cout<<in<<endl;

	for(int i=0; i<in.size(); i++){
		if(in[i] == ' ' || in[i] == '\n'){
			if(out.size() > 2 && out.size() < 7){
				if(flg){ cout<<" "; }
				cout<<out;
				flg = true;
			}
			out = "";
		}else{
			out += in[i];
		}
	}
	cout<<endl;
	return 0;
}

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

#include <iostream>
#include <sstring>
#include <string>

using namespace std;

int main(){
	string in, out;
	bool flg = false;
	getline(cin, in);

	replace(in.begin(), in.end(), ',', ' ');
	replace(in.begin(), in.end(), '.', ' ');
	
	cout<<in.size()<<endl;
	cout<<in<<endl;

	for(int i=0; i<in.size(); i++){
		if(in[i] == ' ' || in[i] == '\n'){
			if(out.size() > 2 && out.size() < 7){
				if(flg){ cout<<" "; }
				cout<<out;
				flg = true;
			}
			out = "";
		}else{
			out += in[i];
		}
	}
	cout<<endl;
	return 0;
}

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

import java.io.*;
public class aoj0084 {
   public static void main(String[] args) throws IOException{
       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
       String tmp = br.readLine();
       int cnt = 0;
       String[] ans = new String[1024];
       char[] s = tmp.toCharArray();
       for(int i=0;i<s.length;i++){
           if(s[i] == ',' || s[i] == '.')  s[i]= ' ';
       }
       tmp = String.valueOf(s);
       String[] data = tmp.split(" ");
       for(int i=0;i<data.length;i++){
           if(data[i].length() > 2 && data[i].length() < 7) {
               ans[cnt] = data[i];
               cnt++;
           }
       }
       for(int i=0;i<cnt;i++){
          if(i == cnt-1) System.out.println(ans[i]);
          else System.out.print(ans[i] + " ");
       }
   }
}

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

import java.io.*;
public class Main {
   public static void main(String[] args) throws IOException{
       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
       String tmp = br.readLine();
       int cnt = 0;
       String[] ans = new String[1024];
       char[] s = tmp.toCharArray();
       for(int i=0;i<s.length;i++){
           if(s[i] == ',' || s[i] == '.')  s[i]= ' ';
       }
       tmp = String.valueOf(s);
       String[] data = tmp.split(" ");
       for(int i=0;i<data.length;i++){
           if(data[i].length() > 2 && data[i].length() < 7) {
               ans[cnt] = data[i];
               cnt++;
           }
       }
       for(int i=0;i<cnt;i++){
          if(i == cnt-1) System.out.println(ans[i]);
          else System.out.print(ans[i] + " ");
       }
   }
}

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

#include<iostream>
int main(){
	char s[1024+1];
	std::cin >> s;
	char k[6+1];
	int l=0;
	
	while(){
		if(*s == '.' || *s == ',' || *s == ' ' || *s == '\0'){
			if(l>=3 && l<=6){
				k[l] = '\0';
				std::cout << k << " ";
			}
			l=0;
			
			if(*s=='\0')
				break;
		}
		k[l] = *s;
		++l;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: expected primary-expression before ')' token
    8 |         while(){
      |               ^
Language: C++

#include<iostream>
int main(){
	char s[1024+1];
	char k[6+1];
	int l=0;
	std::cin >> s;
	
	while(1){
		if(*s == '.' || *s == ',' || *s == ' ' || *s == '\0'){
			if(l>=3 && l<=6){
				k[l] = '\0';
				std::cout << k << " ";
			}
			l=0;
			
			if(*s=='\0')
				break;
		}
		k[l] = *s;
		++l;
		
		++s;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:19: error: lvalue required as increment operand
   22 |                 ++s;
      |                   ^
Language: C++

/*
	0084:Search Engine
*/
#include	<iostream>
#include	<conio>
#include	<string>

using namespace std;

bool IsBreakChar(char c);

int main(void) {
	string str;
	bool IsFirst = true;
	
	getline(cin, str);
	
	int strln = (int)str.length();
	string word;
	for(int i = 0; i < strln; i++) {
		/*str[i]の文字列は区切り文字か？*/
		if( IsBreakChar(str[i]) ) {
			int wordln = (int)word.length();
			/*wordの文字列の長さは条件に合っているか？*/
			if(wordln >= 3 && wordln <= 6) {
				/*出力するのは初めてではないか？*/
				if(IsFirst == false) { cout << ' '; }
				cout << word;
				IsFirst = false;
			}
			word.clear();
		} else {
			word += str[i];
		}
	}
	cout << endl;
	
	return 0;
}

bool IsBreakChar(char c) {
	char brch[3] = { ' ', ',', '.' };
	
	for(int i = 0; i < 3; i++) {
		if(brch[i] == c) { return true; }
	}
	return false;
}

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

#include <iostream>
#include <string>
using namespace std;
int main(){
	string s;
	getline(cin,s);
	char *q,*p,*c=new char[sizeof(s)+1];
	int f=0,n;
	strncpy_s(c,s.size()+1,s.c_str(),s.size()+1);
	p=strtok_s(c," .,",&q);
	while(p!=NULL){
		n=string(p).size();
		if(3<=n&&n<=6){
			cout<<((f==1)?" ":"\0")<<p;
			f=1;
		}
		p=strtok_s(NULL," .,",&q);
	}
	cout<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'strncpy_s' was not declared in this scope
    9 |         strncpy_s(c,s.size()+1,s.c_str(),s.size()+1);
      |         ^~~~~~~~~
a.cc:10:11: error: 'strtok_s' was not declared in this scope; did you mean 'strtol_l'?
   10 |         p=strtok_s(c," .,",&q);
      |           ^~~~~~~~
      |           strtol_l
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
	string s;
	getline(cin,s);
	char *q,*p,*c=new char[sizeof(s)+1];
	int f=0,n;
	strncpy(c,s.c_str(),s.size()+1);
	p=strtok(c," .,");
	while(p!=NULL){
		n=string(p).size();
		if(3<=n&&n<=6){
			cout<<((f==1)?" ":"\0")<<p;
			f=1;
		}
		p=strtok(NULL," .,");
	}
	cout<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'strncpy' was not declared in this scope
    9 |         strncpy(c,s.c_str(),s.size()+1);
      |         ^~~~~~~
a.cc:2:1: note: 'strncpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
a.cc:10:11: error: 'strtok' was not declared in this scope; did you mean 'strtoq'?
   10 |         p=strtok(c," .,");
      |           ^~~~~~
      |           strtoq
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
	string s;
	int i;
	getline(cin, s);
	for(i=0;i<s.size();i++)
	if(s[i]==','||s[i]=='.')s[i]=' ';
	stringstream ss;
	ss<<s;
	int f=0,n;
	while(ss>>s){
		n=s.size();
		if(n>=3&&n<=6){
			cout<<((f==1)?" ":"")<<s;
			f=1;
		}
	}
	cout<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: aggregate 'std::stringstream ss' has incomplete type and cannot be defined
   10 |         stringstream ss;
      |                      ^~
Language: C

#include<stdio.h>

int a[1010],m,n,i,b,c;

int main(){
    scanf("%d%d",&n,&m);
    while(n!=0 && m!=0){
        for(i=1;i<=n;i++)a[i]=1;
        b=i=n;
        while(a>1){
            c=0;
            while(c<m){
                i++;if(i>n)i=1;
                c+=b[i];
            }
            a[i]=0;b--;
        }
        for(i=1;i<=n;i++)if(a[i]==1)printf("%d\n",i);
        scanf("%d%d",&n,&m);
    }
    
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:16: warning: comparison between pointer and integer
   10 |         while(a>1){
      |                ^
main.c:14:21: error: subscripted value is neither array nor pointer nor vector
   14 |                 c+=b[i];
      |                     ^
Language: C

#include<stdio.h>
 
int main(void)
{
    int n,m,i,j,count;
    int num[1001];
 
    while(scanf("%d%d",&n,&m),n+m){
 
        count=0;
        for(i=0;i<1001;i++){
            num[i]=0;
        }
        for(i=0;i<n+1;i++){
            num[i]=i;
        }
 
        for(i=m;n-count>m;i+=m-1){
 
            if(i>=n-count){
                i%=n-count;
            }count++;
            for(j=i;j<n+1;j++){
                num[j]=num[j+1];
            }
 
        }

        for(;n-count>2;i+=(m-1)%(n-count)){
 
            if(i>=n-count){
                i%=n-count;
            }count++;
            for(j=i;j<n+1;j++){
                num[j]=num[j+1];
            }
 
        }

      //  for(i=1;i<=n;i++)
        printf("%d\n",num[1]);
//puts("");
//    }
 
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:46:1: error: expected declaration or statement at end of input
   46 | }
      | ^
Language: C


void potato(int n,int m){
    int i;
    
    int x[n];   //x[0]をn人目とする
    //x[i]:iの右隣の数字を格納
    for(i=0;i<n;i++){
        if(i==n-1)x[i]=0;
        else x[i]=i+1;
    }
    
    int prev,now=0;
    int count=0;
    while(count<=m*(n-1)){
        prev=now;
        now=x[now];
        count++;
        if(count%m==0)x[prev]=x[now];
    }
    printf("%d\n",now);
return 0;
}



Compiler output:
main.c: In function 'potato':
main.c:20:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   20 |     printf("%d\n",now);
      |     ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | 
main.c:20:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   20 |     printf("%d\n",now);
      |     ^~~~~~
main.c:20:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:21:8: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   21 | return 0;
      |        ^
main.c:2:6: note: declared here
    2 | void potato(int n,int m){
      |      ^~~~~~
Language: C

#include <iostream>

int main(int argc,char* argv[]){
  bool peeple[1001];

  while(true){
    int pop,space;
    std::cin >> pop >> space;
    if(pop == 0 && space == 0){break;}

    for(int i = 1; i <= pop; i++){
      peeple[i] = false;
    }
    
    int cur_pop = pop;
    int cur_num = 1;
    while(cur_pop != 1){
      int count = 0;
      while(count < (space-1) || peeple[cur_num] == true){
	if(peeple[cur_num] == true){
	  if(cur_num == pop){
	    cur_num = 1;
	  }else{
	    cur_num++;
	  }
	  continue;
	}else{
	  if(cur_num == pop){
	    cur_num = 1;
	  }else{
	    cur_num++;
	  }
	  count++;
	}
      }
      
      peeple[cur_num] = true;
      cur_pop--;
      while(peeple[cur_num] == true){
	if(cur_num == pop){
	  cur_num = 1;
	}else{
	  cur_num++;
	}
      }
    }
    
    for(int i = 1; i <= pop;i++){
      if(peeple[i] == false){
	std::cout << i << std::endl;
	break;
      }
    }
  }

  return 0;
  
}

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

#include <stdio.h>
#define MAX 1000

int main(void){
  int n,m,num[MAX],i,cnt,j;

  while(1){
    cnt = 0;
    for(i = 0; i < MAX ; i++) num[i] = 0;

    scanf("%d %d", &n ,&m);
    if(n == 0 && m == 0) break;
    for(i = 0 ; i < n ; i++) num[i] = i+1;    
    
    j = 1;    
    while(1){
      if(cnt == n - 1) break;
      num[m-1] = 0;
      j++;
      m*=j;
      if(m > n) m -= n;
    }
    for(i = 0 ; i < n ; i++){
      if(num[i] != 0) print("%d\n" ,num[i]);
    }
  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:23: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   24 |       if(num[i] != 0) print("%d\n" ,num[i]);
      |                       ^~~~~
      |                       printf
Language: C++

import std.stdio,std.string,std.conv;

int main()
{
	string s;
	int a[1001];
	while((s = readln.chomp).length != 0)
	{
		string[] _s = s.split(" ");
		int n = _s[0].to!int;
		int m = _s[1].to!int;

		if(n == 0 && m == 0)
		{
			break;
		}

		foreach(i;0..n)
		{
			a[i] = 1;
		}

		int count = 0;
		int delete_count = 0;

		for(int i=0; i < n ; i++)
		{
			if(delete_count == n-1)
			{
				break;
			}
			
			if(a[i] == 1)
			{
				count++;
				
				if(count == m)
				{
					a[i] = 0;
					count = 0;
					delete_count++;
				}
			}
			
			if(i == n-1)
			{
				i = -1;
			}
		}

		foreach(i;0..n)
		{
			if(a[i] == 1)
			{
				(i+1).writeln;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc:18:27: error: too many decimal points in number
   18 |                 foreach(i;0..n)
      |                           ^~~~
a.cc:51:27: error: too many decimal points in number
   51 |                 foreach(i;0..n)
      |                           ^~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import std.stdio,std.string,std.conv;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc: In function 'int main()':
a.cc:5:9: error: 'string' was not declared in this scope
    5 |         string s;
      |         ^~~~~~
a.cc:7:16: error: 's' was not declared in this scope
    7 |         while((s = readln.chomp).length != 0)
      |                ^
a.cc:7:20: error: 'readln' was not declared in this scope
    7 |         while((s = readln.chomp).length != 0)
      |                    ^~~~~~
a.cc:9:24: error: expected primary-expression before ']' token
    9 |                 string[] _s = s.split(" ");
      |                        ^
a.cc:10:25: error: '_s' was not declared in this scope
   10 |                 int n = _s[0].to!int;
      |                         ^~
a.cc:18:25: error: 'i' was not declared in this scope
   18 |                 foreach(i;0..n)
      |                         ^
a.cc:51:26: error: expected ')' before ';' token
   51 |                 foreach(i;0..n)
      |                        ~ ^
      |                          )
Language: C++

#include<stdio.h>

int main()
{

bool num[1001]={};
int N,M;
int ii=0;
int cou=0;
while(1){
scanf("%d %d",&N,&M);
if(N==0&&M==)break;
for(int i=0;i<1000;i++)
num[i]=true;

do{
if(num[ii]==true){cou++;num[ii]=false;}

ii=(ii+1)%M;


}while(cou<N-1)

for(int i=0;i<N;i++){int t=i+1;
if(num[i]==true;)printf("%d\n",t);
ii=0;cou=0;
for(int i=0;i<1000;i++)
num[i]=true;}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: expected primary-expression before ')' token
   12 | if(N==0&&M==)break;
      |             ^
a.cc:22:16: error: expected ';' before 'for'
   22 | }while(cou<N-1)
      |                ^
      |                ;
   23 | 
   24 | for(int i=0;i<N;i++){int t=i+1;
      | ~~~             
a.cc:25:17: error: expected primary-expression before ')' token
   25 | if(num[i]==true;)printf("%d\n",t);
      |                 ^
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

#include <string.h>
#include <iostream>
#include<time.h>

using namespace std;

int main()
{
	const int MAX_DATAS = 1000;

	int N[MAX_DATAS], M[MAX_DATAS], CHECK[1099], ANS[MAX_DATAS], C1 = 0, C = 1, D = 1, E = 0;
	
	while (true)
	{
		memset(CHECK, -1, sizeof(CHECK)); // -1

		C = 1; D = 1; E = 0;

		cin >> N[C1] >> M[C1];

		if (M[C1] == 1) { ANS[C1] = N[C1]; goto Exit2:; }

		if (N[C1] == 0 && M[C1] == 0) { goto Exit3; }

		while (true)
		{
			if (CHECK[C] % M[C1] != 0)
			{
				CHECK[C] = D;

				if (D % M[C1] == 0) { E++; }

				D++;
			}

			C++;

			if (C > N[C1]) { C -= N[C1]; }

			if (E == N[C1]) { goto Exit1; }
		}

	Exit1:;

		for (int i = 1; i <= N[C1]; i++)
		{
			CHECK[i] /= M[C1];
		}

		for (int i = 1; i <= N[C1]; i++)
		{
			if (CHECK[i] == N[C1]) { ANS[C1] = i; }
		}

	Exit2:;

		C1++;
	}

Exit3:;

	for (int i = 0; i < C1; i++)
	{
		cout << ANS[i] << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:62: error: expected ';' before ':' token
   21 |                 if (M[C1] == 1) { ANS[C1] = N[C1]; goto Exit2:; }
      |                                                              ^
      |                                                              ;
a.cc:21:62: error: expected primary-expression before ':' token
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
	int n,k,m,i;
	for(;cin>>n>>k,n;;){
		vector<int>vec(n);
		for(i=0;i<n;i++)vec[i]=i+1;
		i=(m-1)%vec.size();
		vec.erase(vec.begin()+i);
		for(;vec.size()>1;vec.erase(vec.begin()+i))if(i+=(k-1)%vec.size(),i>=vec.size())i-=vec.size();
		cout<<vec[0]<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:26: error: expected primary-expression before ';' token
    6 |         for(;cin>>n>>k,n;;){
      |                          ^
a.cc:6:26: error: expected ')' before ';' token
    6 |         for(;cin>>n>>k,n;;){
      |            ~             ^
      |                          )
a.cc:6:27: error: expected primary-expression before ')' token
    6 |         for(;cin>>n>>k,n;;){
      |                           ^
Language: C++

#include<iostream>
using namespace std;

int potato(int x, int y)
{
 for(int i=y-2; i<(y-2)*x; i=(i*y)/(y-1)+1)
 return(x*y-i);
 }
 int main()
{
 while(cin>>x>>y, x || y)
 {
  cout<<potato(x,y)<<endl;
  }
 return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'x' was not declared in this scope
   11 |  while(cin>>x>>y, x || y)
      |             ^
a.cc:11:16: error: 'y' was not declared in this scope
   11 |  while(cin>>x>>y, x || y)
      |                ^
a.cc: In function 'int potato(int, int)':
a.cc:8:2: warning: control reaches end of non-void function [-Wreturn-type]
    8 |  }
      |  ^
Language: C++

#include <iostream> 
using namespace std;   

int pt(int n, int m){   
  for(int i = m-1 ; i < (m-1)*n ; i = (m*i) / (m-1)+1);
  return (m*n-i); 
  }   

int main(){     
  int n,m;  
  
  while( cin >> n >> m , n || m ) cout << pt(n,m) << endl;    
   
  return 0;
 }

Compiler output:
a.cc: In function 'int pt(int, int)':
a.cc:6:15: error: 'i' was not declared in this scope
    6 |   return (m*n-i);
      |               ^
Language: C++

#include <iostream> 
using namespace std;   

int pt(int n, int m){  
  int i; 
  for(i = m-1 ; i < (m-1)*n ; i = (m*i) / (m-1)+1);
  return (m*n-i); 
  }   

int main(){     
  int n,m;  
  
  while( cin >> n >> k , n || k ) cout << pt(n,m) << endl;    
   
  return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: 'k' was not declared in this scope
   13 |   while( cin >> n >> k , n || k ) cout << pt(n,m) << endl;
      |                      ^
Language: C++

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

int main(){
int a[1001],i,n,m,f,t;

while(1){
scanf("%d %d",&n,&m);
if(n==0&&m==0)break;
for(i=1;i<=n;i++)a[i]=i;
i=1;
f=0;
t=0;
while(1){
if(t==n-1)break;
if(a[i]!=0)f++;
if(f==m){
a[i]=0;
t++;
f=0;
}
i++;
if(i==n+1)i=1;
}
for(i=1;i<=n;i++){
if(a[i]!=0){
printf("%d\n",a[i]);
}
}
return 0;
}

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

while 1:
  n,m=map(int,raw_input().split())
  if n==0&m==0:break
  G=range(1,n+1)
  while n>1:
    if m%n==0:G=G[:n-1]
    else:G=G[m%n:]+G[:(m-1)%n]
    n-=1
  print G[0]

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while 1:
      | ^~~~~
Language: Java


public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		while (scanner.hasNext()) {
			int[] map = new int[101];
			while (true) {
				int n = scanner.nextInt();
				int s = scanner.nextInt();
				if (n == 0 && s == 0) {
					break;
				}
				map[n]++;
				map[s]++;
			}
			int count = 0;
			for (int i = 0; i < 101; i++) {
				if (map[i] % 2 == 1) {
					count++;
				}

			}
			if (count != 2) {
				System.out.println("NG");
			} else if (map[1] % 2 == 1 && map[2] % 2 == 1) {
				System.out.println("OK");
			} else {
				System.out.println("NG");
			}
		}
	}
}

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

import java.util.*;
public class Mai {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()) {
			boolean f[] = new boolean[105];
			int c = 0;
			for(;;) {
				int a = sc.nextInt(), b = sc.nextInt();
				if( (a|b) == 0 ) break;
				f[a] = !f[a]; f[b] = !f[b]; c += f[a]? 1: -1; c += f[b]? 1: -1;
			}
			System.out.println( (c>3? "NG": "OK") );
		}
	}
}

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

import java.util.Arrays;
import java.util.Scanner;


public class Maim {

	Scanner sc;
	
	boolean solve(int[] edges){
		for(int i=2;i<100;++i){
			if(edges[i]%2!=0){
				return false;
			}
		}
		if((edges[0]+edges[1])%2!=0)return false;
		else{
			return true;
		}
	}
	
	int ni(){
		return sc.nextInt();
	}
	
	void io(){
		int[] edges=new int[100];
		sc=new Scanner(System.in);
		
		while(sc.hasNext()){
			Arrays.fill(edges, 0);
			int a,b;
			while(true){
				a=ni();b=ni();
				if(a==0&&b==0)break;
				edges[a-1]++;edges[b-1]++;
			}
			System.out.println(solve(edges)?"OK":"NG");
		}
		sc.close();
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		new Maim().io();
	}

}

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

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int array[]=new int[50];
		int count=0,a,b;
		while(true){
			for(int i=0;i<50;i++){
				array[i]=0;
			}
			while(true){
				a=scan.nextInt();
				b=scan.nextInt();	
				array[a]++;
				array[b]++;
				if(a==0){
					if(b==0){
						break;
					}
				}
			}
			for(int i=0;i<50;i++){
				if(array[1]%2==1&&array[2]==2){
					if(array[i]%2==0){
						if(i==50){
							System.out.println("OK");
						}
					}
					else{
						System.out.println("NG");
						break;
					}
				}
				else{
					System.out.println("NG");
					break;
				}
			}
			if(!scan.hasNext()){
				break;
			}
		}
	}
}

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

#include<iostream>
using namespace std;
int cnt[200];
main()
{
    int a,b;
    while(cin>>a>>b)
    {
        for(int i=1;i<=100;i++)cnt[i]=0;
        cnt[a]++,cnt[b]++;
        while(cin>>a>>b,a)cnt[a]++,cnt[b]++;
        int c=0;a=b=0;
        for(int i=1;i<=100;i++)
        {
            c+=cnt[i]%2;
            if(cnt[i]%2)
            {
                if(a)b=i;
                else a=i;
            }
        cout<<(c==0?"OK":c==2&&a==1&&b==2?"OK":"NG")<<endl;
    }
}


Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int path[101];
int main(void)
{
	int a, b;
	while (cin >> a >> b)
	{
		if(a == 0 && b == 0)
		{
			bool ans = all_of(path + 3, path + 100, [=](int n){return n % 2 == 0;});
			cout << (ans ? "OK" : "NG") << endl;
			memset(path, 0, sizeof(path));
		}
		path[a]++;
		path[b]++;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:25: error: 'memset' was not declared in this scope
   16 |                         memset(path, 0, sizeof(path));
      |                         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 |
Language: C++

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

int list[100];

int main(void){
	int a, b, odd = 0;
	while(scanf("%d %d", &a, &b) != EOF){
		if(a || b){
			list[a-1]++;	list[b-1]++;
		}else{
			for(int i = 0; i < 100; i++){
				if(list[i] % 2 != 0) odd++;
			}
			if(odd == 2){
				printf("OK\n");
				memset(list, 0, 100);
			}else{
				printf("NG\n");
				memset(list, 0, 100);
			}
		}
	}
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:33: error: 'memset' was not declared in this scope
   18 |                                 memset(list, 0, 100);
      |                                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cstdio>
  +++ |+#include <cstring>
    3 | using namespace std;
a.cc:21:33: error: 'memset' was not declared in this scope
   21 |                                 memset(list, 0, 100);
      |                                 ^~~~~~
a.cc:21:33: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <cstring>
#include <cstdio>
#include <cstring>
using namespace std;

int list[100];

int main(void){
	int a, b;
	bool flag = false;
	while(scanf("%d %d", &a, &b)){
		memset(list, 0, 100);
		list[a-1]++;
		list[b-1]++;
		while(true){
			cin >> a >> b;
			if(!a && !b)	break;
			list[a-1]++;
			list[b-1]++;
		}
		flag = false;
		if(!(list[0] & 1) || !(list[1] & 1))	flag = true;
		for(int i = 2; i < 100; i++){
			if(list[i] & 1)	flag = true;
		}
		if(!flag) printf("OK\n");
		else printf("NG\n");
	}
  return 0;
}

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

#include<iostream>
using namespace std;

int main()
{
    while(cin>>a>>b)
    {
        int hen[51]={};
        hen[a]++;
        hen[b]++;
        if(a==0){
            if(hen[1]%2==1&&hen[2]%2==1&&
               for(int i=3;i<51;i++)hen[i]%2==0))
                cout<<"OK"<<endl;
            else
                cout<<"NG"<<endl;
            for(int i=0;i<51;i++)
                hen[i]=0;
        }
        
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: 'a' was not declared in this scope
    6 |     while(cin>>a>>b)
      |                ^
a.cc:6:19: error: 'b' was not declared in this scope
    6 |     while(cin>>a>>b)
      |                   ^
a.cc:13:16: error: expected primary-expression before 'for'
   13 |                for(int i=3;i<51;i++)hen[i]%2==0))
      |                ^~~
a.cc:12:42: error: expected ')' before 'for'
   12 |             if(hen[1]%2==1&&hen[2]%2==1&&
      |               ~                          ^
      |                                          )
   13 |                for(int i=3;i<51;i++)hen[i]%2==0))
      |                ~~~                        
a.cc:13:28: error: 'i' was not declared in this scope
   13 |                for(int i=3;i<51;i++)hen[i]%2==0))
      |                            ^
a.cc:15:13: error: expected '}' before 'else'
   15 |             else
      |             ^~~~
a.cc:11:17: note: to match this '{'
   11 |         if(a==0){
      |                 ^
a.cc: At global scope:
a.cc:22:5: error: expected unqualified-id before 'return'
   22 |     return 0;
      |     ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

int main()
{
    while(cin>>a>>b)
    {
        int hen[101]={};
        hen[a]++;
        hen[b]++;
        if(a==0){
            if(hen[1]%2==1&&hen[2]%2==1)
            {
                for(int i=3;i<101;i++){
                   if(i<=100&&hen[i]%2==1)
                       cout<<"NG"<<endl;
                    if(i==100)cout<<"OK"<<endl;
                    else
                        cout<<"BG"<<endl;
                }
            for(int i=0;i<101;i++)
                hen[i]=0;
        }
        
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: 'a' was not declared in this scope
    6 |     while(cin>>a>>b)
      |                ^
a.cc:6:19: error: 'b' was not declared in this scope
    6 |     while(cin>>a>>b)
      |                   ^
a.cc:27:2: error: expected '}' at end of input
   27 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++


#include<iostream>
using namespace std;

int main()
{
    while(cin>>a>>b)
    {
        int hen[101]={};
        hen[a-1]++;
        hen[b-1++;
        if(a==0){
            if(hen[0]%2==1&&hen[1]%2==1)
            {
                for(int i=2;i<101;i++){
                   if(i<100&&hen[i]%2==1)
                       cout<<"NG"<<endl;
                    if(i==100)cout<<"OK"<<endl;
                    else
                        cout<<"BG"<<endl;
                }
            for(int i=0;i<101;i++)
                hen[i]=0;
        }
        
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: 'a' was not declared in this scope
    7 |     while(cin>>a>>b)
      |                ^
a.cc:7:19: error: 'b' was not declared in this scope
    7 |     while(cin>>a>>b)
      |                   ^
a.cc:11:15: error: lvalue required as increment operand
   11 |         hen[b-1++;
      |               ^
a.cc:11:18: error: expected ']' before ';' token
   11 |         hen[b-1++;
      |                  ^
      |                  ]
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^