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

import java.until.Scanner;

class Main{

    Main(){
	readscores();
	showResult();
	System.out.println("END");
    }

    void readscores(){
	scanner sc = new Scanner(System.in);
	while(sc.hasNext){
	    int W = sc.nextInt();
	    int Q = sc.nextInt();
	}
	while(sc.hasNext){
	    String c  = sc.nextInt();
	    int id = sc.nextInt();
	    int w = sc.nextInt();
	}
    }

    void showResult(){
	if(W = 0 && Q = 0) break;
	else if(w <= W && c = "s"){
	    W = W - w;
	    System.out.println(W);
	}
	else if(w > W && c = "s"){
	    System.out.println("impossible");
	}
	else if(c = "w"){
	    W = W + w;
	}
    }

    public static void main(String[] args){
	new Main();
    }
}

Compiler output:
Main.java:1: error: package java.until does not exist
import java.until.Scanner;
                 ^
Main.java:12: error: cannot find symbol
	scanner sc = new Scanner(System.in);
	^
  symbol:   class scanner
  location: class Main
Main.java:12: error: cannot find symbol
	scanner sc = new Scanner(System.in);
	                 ^
  symbol:   class Scanner
  location: class Main
Main.java:25: error: cannot find symbol
	if(W = 0 && Q = 0) break;
	   ^
  symbol:   variable W
  location: class Main
Main.java:25: error: cannot find symbol
	if(W = 0 && Q = 0) break;
	            ^
  symbol:   variable Q
  location: class Main
Main.java:25: error: break outside switch or loop
	if(W = 0 && Q = 0) break;
	                   ^
Main.java:26: error: cannot find symbol
	else if(w <= W && c = "s"){
	        ^
  symbol:   variable w
  location: class Main
Main.java:26: error: cannot find symbol
	else if(w <= W && c = "s"){
	             ^
  symbol:   variable W
  location: class Main
Main.java:26: error: cannot find symbol
	else if(w <= W && c = "s"){
	                  ^
  symbol:   variable c
  location: class Main
Main.java:27: error: cannot find symbol
	    W = W - w;
	    ^
  symbol:   variable W
  location: class Main
Main.java:27: error: cannot find symbol
	    W = W - w;
	        ^
  symbol:   variable W
  location: class Main
Main.java:27: error: cannot find symbol
	    W = W - w;
	            ^
  symbol:   variable w
  location: class Main
Main.java:28: error: cannot find symbol
	    System.out.println(W);
	                       ^
  symbol:   variable W
  location: class Main
Main.java:30: error: cannot find symbol
	else if(w > W && c = "s"){
	        ^
  symbol:   variable w
  location: class Main
Main.java:30: error: cannot find symbol
	else if(w > W && c = "s"){
	            ^
  symbol:   variable W
  location: class Main
Main.java:30: error: cannot find symbol
	else if(w > W && c = "s"){
	                 ^
  symbol:   variable c
  location: class Main
Main.java:33: error: cannot find symbol
	else if(c = "w"){
	        ^
  symbol:   variable c
  location: class Main
Main.java:34: error: cannot find symbol
	    W = W + w;
	    ^
  symbol:   variable W
  location: class Main
Main.java:34: error: cannot find symbol
	    W = W + w;
	        ^
  symbol:   variable W
  location: class Main
Main.java:34: error: cannot find symbol
	    W = W + w;
	            ^
  symbol:   variable w
  location: class Main
20 errors
Language: C++

#include <iostream>

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)

int main() {
  
  int W, Q;
  while(cin >> W >> Q && (W|Q)) {
    int line[W];
    memset(line, -1, sizeof line);
    rep(_, Q) {
      char ch; cin >> ch;
      if(ch == 's') {
        int id, w;
        cin >> id >> w;
        bool good = 0;
        rep(i, W-w+1) {
          if(line[i] == -1) {
            bool ok = 1;
            rep(j, w) if(line[i+j] != -1) { ok = 0; break; }
            if(ok) { rep(j, w) line[i+j] = id; cout << i << endl; good = 1; break; }
          }
        }
        if(!good) {
          cout << "impossible\n";
        }
      }
      else {
        int id; cin >> id;
        rep(i, W) {
          for(int j=0; i+j<W && line[i+j] == id; j++) line[i+j] = -1;
        }
      }
    }
    cout << "END\n";
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'memset' was not declared in this scope
   13 |     memset(line, -1, sizeof line);
      |     ^~~~~~
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 |
Language: C++

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



int main(){

	int W,Q;int x,w;
	string str;
	while(1){
		int N[101]={};
		for(int i=0;i<101;i++)
			N[i]=999;


	cin>>W>>Q;if(W==0&&Q==0)break;
	for(int i=0;i<Q;i++){
		cin>>str;
		if(str=="s"){
		cin>>x>>w;bool f=false;
		for(int I=0;I<W;I++){int L=0;if(f==true)break;
			for(int J=I;J<W;J++)
				if(N[J]==999){L++;if(L==w){f=true;cout<<I<<endl;
					for(int j=I;j<I+w;j++)
						N[j]=x;
						L=0;break;	}
					}
				else{L=0;break;}
		}
		if(f==false)cout<<"impossible"<<endl;
		}
		else{
		cin>>x;
		for(int I=0;I<101;I++)
			if(N[I]==x)N[I]=999;
		
		
		}
		//for(int I=0;I<W;I++)
			//cout<<N[I]<<endl;
	}
	cout<<END<<endl;
	}
	return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:15: error: 'END' was not declared in this scope
   45 |         cout<<END<<endl;
      |               ^~~
Language: C++

#include<iostream>
using namespace std;

int x[1000],n,q,a,b;
int y[1000][2];
char c;

int main(){
	while(true){
		for(int i=0;i<1000;i++){x[i]=0;y[i][0]=0;y[i][1]=0;}
		cin>>n>>q;
		if(n==0 && q==0){break;}
		for(int i=0;i<q;i++){
			cin>>c>>a>>b;
			if(c=='s'){
				for(int j=0;j<=a-b;j++){
					int t=b;
					for(int k=j;k<j+b;k++){
						if(x[k]==0){
							t--;
						}
					}
					if(t==0){
						cout<<j<<endl;
						for(int k=j;k<j+b;k++){
							x[k]=1;
						}
						y[a][0]=j;x[a][1]=j+b;
						goto E;
					}
				}
				cout<<"impossible"<<endl;
E:;
			}
			if(c=='w'){
				for(int j=y[a][0];j<y[a][1];j++){
					x[j]=0;
				}
				y[a][0]=0;y[a][1]=0;
			}
		}
		cout<<"END"<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:63: error: invalid types 'int[int]' for array subscript
   28 |                                                 y[a][0]=j;x[a][1]=j+b;
      |                                                               ^
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#define P pair<int,string>
using namespace std;

int main()
{
	int a, b;
	while (cin >> b>>a, a | b) {
		int c[100]{};
		for (int d = 0; d < a; d++) {
			char e; cin >> e;
			if (e == 's') {
				int f, g; cin >> f >> g; f++;
				int s = 0;
				for (int i = 0; i < b; i++) {
					if (c[i] == 0) {
						s++; 
						if (s >= g) {
							cout << i - s + 1 << endl;
							for (int o = i-s+1; o <= i; o++)c[o] = f;
							break;
						}
					}
					else s = 0;
					if (b - 1 == i)puts("impossible");
				}
			}
			else {
				int f; cin >> f; f++;
				for (int i = 0; i < b; i++) {
					if (c[i] == f)c[i] = 0;
				}
		}
	}
	puts("END");
}

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

#include<bits/stdc++.h>
#define P pair<int,string>
using namespace std;

int main()
{
	int a, b;
	while (cin >> b>>a, a | b) {
		int c[100]{};
		for (int d = 0; d < a; d++) {
			char e; cin >> e;
			if (e == 's') {
				int f, g; cin >> f >> g; f++;
				int s = 0;
				for (int i = 0; i < b; i++) {
					if (c[i] == 0) {
						s++; 
						if (s >= g) {
							cout << i - s + 1 << endl;
							for (int o = i-s+1; o <= i; o++)c[o] = f;
							break;
						}
					}
					else s = 0;
					if (b - 1 == i)puts("impossible");
				}
			}
			else {
				int f; cin >> f; f++;
				for (int i = 0; i < b; i++) {
					if (c[i] == f)c[i] = 0;
				}
		}
	}
	puts("END");
}

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

#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
	int w,n,s[100],sp,x,y;
	char c;
	while(cin>>w>>n,w||n){
		memset(s,-1,sizeof(s));
		for(int i=0;i<n;i++){
			cin>>c;
			if(c=='w'){
				cin>>x;
				for(int j=0;j<w;j++){
					if(s[j]==x)
					s[j]=-1;
				}
			}else{
				int j,k;
				cin>>x>>y;
				for(j=0;j<w;j++){
					if(s[j]==-1){
						for(k=j;k<w;k++){
							if(-1!=s[k]){
								break;
							}
						}
						sp=k-j;
						if(sp>=y){
							cout<<j<<endl;
							for(int h=j;h<y+j;h++)
							s[h]=x;
							break;
						}
					}
				}
				if(j==w)
				cout<<"impossible"<<endl;
			}
			
		}
		cout<<"END"<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'memset' was not declared in this scope
    8 |                 memset(s,-1,sizeof(s));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<cstdlib>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include <cstdio>
#include <vector>
#define R second.second
using namespace std;
typedef vector<pair<int,pair<int,int> > >vpp;

int main(){
	int W,Q,d,w;
	char s[2];
	for(;scanf("%d%d",&W,&Q),W;){ //some case Q==0.
		vpp v;
		v.push_back(make_pair(-2,make_pair(0,0)));
		v.push_back(make_pair(-1,make_pair(W,0)));
		for(;Q;Q--){
			scanf("%s",s);
			if(*s=='w'){
				scanf("%d",&d);
				for(int i=0;i<v.size();i++)if(v[i].first==d){v.erase(v.begin()+i);break;}
			}else{
				scanf("%d%d",&d,&w);
				for(int i=0;~v[i].first;i++){
					if(v[i+1].second.first-v[i].R>=w){
						v.insert(v.begin()+i+1,make_pair(d,make_pair(v[i].R,v[i].R+w)));
						printf("%d\n",v[i].R);break;
					}
				}
				if(v[i].first==-1)puts("impossible");
			}
		}
		puts("END");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:38: error: 'i' was not declared in this scope
   27 |                                 if(v[i].first==-1)puts("impossible");
      |                                      ^
Language: C++

#include <cstdio>
#include <vector>
#define R second.second
#define Z(i,a,b,c)v.insert(v.begin()+i,make_pair(a,make_pair(b,c)))
using namespace std;
main(){
	int W,Q,d,w,i;char s[2];
	for(;scanf("%d%d",&W,&Q),W;puts("END"))//some case Q==0
		for(vector<pair<int,pair<int,int> > >v,Z(0,-2,0,0),Z(1,-1,W,0);Q;Q--)
			if(scanf("%s",s),*s-'w'){
				for(scanf("%d%d",&d,&w),i=0;~v[i].first;i++)if(v[i+1].second.first-v[i].R>=w){Z(i+1,d,v[i].R,v[i].R+w);printf("%d\n",v[i].R);break;}
				if(v[i].first==-1)puts("impossible");
			}else for(scanf("%d",&d),i=0;i<v.size();i++)if(v[i].first==d){v.erase(v.begin()+i);break;}
}

Compiler output:
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:4:20: error: expected ';' before '.' token
    4 | #define Z(i,a,b,c)v.insert(v.begin()+i,make_pair(a,make_pair(b,c)))
      |                    ^
a.cc:9:56: note: in expansion of macro 'Z'
    9 |                 for(vector<pair<int,pair<int,int> > >v,Z(0,-2,0,0),Z(1,-1,W,0);Q;Q--)
      |                                                        ^
a.cc:4:20: error: expected primary-expression before '.' token
    4 | #define Z(i,a,b,c)v.insert(v.begin()+i,make_pair(a,make_pair(b,c)))
      |                    ^
a.cc:9:56: note: in expansion of macro 'Z'
    9 |                 for(vector<pair<int,pair<int,int> > >v,Z(0,-2,0,0),Z(1,-1,W,0);Q;Q--)
      |                                                        ^
a.cc:9:81: error: expected ')' before ';' token
    9 |                 for(vector<pair<int,pair<int,int> > >v,Z(0,-2,0,0),Z(1,-1,W,0);Q;Q--)
      |                    ~                                                            ^
      |                                                                                 )
a.cc:9:85: error: expected ';' before ')' token
    9 |                 for(vector<pair<int,pair<int,int> > >v,Z(0,-2,0,0),Z(1,-1,W,0);Q;Q--)
      |                                                                                     ^
      |                                                                                     ;
a.cc:13:26: error: 'else' without a previous 'if'
   13 |                         }else for(scanf("%d",&d),i=0;i<v.size();i++)if(v[i].first==d){v.erase(v.begin()+i);break;}
      |                          ^~~~
a.cc:13:56: error: 'v' was not declared in this scope
   13 |                         }else for(scanf("%d",&d),i=0;i<v.size();i++)if(v[i].first==d){v.erase(v.begin()+i);break;}
      |                                                        ^
Language: C++

#include<iostream>
#include<string>
using namespace std;
string S, T, U;
int main() {
	while (true) {
		cin >> T; if (T == "-")break; cin >> S >> U; string V = ""; int c = 0;
		reverse(S.begin(), S.end()); reverse(T.begin(), T.end()); T += S[S.size() - 1];
		while (S.size() + T.size() >= 1) {
			cout << S << ' ' << T << endl;
			if (c < U.size() && U[c] == S[S.size() - 1]) {
				T = T.substr(0, T.size() - 1);
				if (T.size() >= 1)S[S.size() - 1] = T[T.size() - 1];
				if (T.size() == 0)S = "";
				c++;
			}
			else {
				V += S[S.size() - 1]; S = S.substr(0, S.size() - 1);
				if (S.size() >= 1)T[T.size() - 1] = S[S.size() - 1];
				if (S.size() == 0)T = "";
			}
		}
		cout << V << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'reverse' was not declared in this scope
    8 |                 reverse(S.begin(), S.end()); reverse(T.begin(), T.end()); T += S[S.size() - 1];
      |                 ^~~~~~~
Language: C++

#include <string>
#include <iostream>
using namespace std;
string a, b, c;
int main() {
	while (cin >> a, a != "-") {
		cin >> b >> c;
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());
		char r = b.back(); b.pop_back();
		string ret;
		while (true) {
			if (c.find(r) != string::npos) {
				if (a.size() == 0) break;
				r = a.back(); a.pop_back();
			}
			else {
				ret += r;
				if (b.size() == 0) break;
				r = b.back(); b.pop_back();
			}
		}
		cout << ret << endl;
	}
	return 0;
}

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

#include <iostream>
#include <vector>
#include <queue>
using namespace std;
 
int main(){
    while(true){
        string Red,Green,Out;
        // cin>>Red;
        getline(cin,Red);
        if(Red[0]=='-') return 0;
        // cin>>Green>>Out;
        getline(cin,Green);
        getline(cin,Out);
        if(!Out.size()){
            cout<<Green<<endl;
            continue;
        }
        // cout<<Red<<' '<<Green<<' '<<Out<<endl;
        queue<char> R,G,O;
        for(auto c:Red) R.push(c);
        for(auto c:Green) G.push(c);
        for(auto c:Out) O.push(c);
 
        char centre = G.front(); G.pop();
        int cnt = Green.size();
        while(true){
            // cout<<'?'<<centre<<' '<<O.front()<<endl;
            if(!O.empty()&?¢re==O.front()){
                centre=R.front(); R.pop();
                O.pop();
            }else{
                cout<<centre;
                cnt--;
                if(!cnt){
                    cout<<endl;
                    break;   
                }
                centre=G.front(); G.pop();                    
            }
        }
    }
 
    return 0;
}

Compiler output:
a.cc:29:28: error: extended character ¢ is not valid in an identifier
   29 |             if(!O.empty()&?¢re==O.front()){
      |                            ^
a.cc: In function 'int main()':
a.cc:29:27: error: expected primary-expression before '?' token
   29 |             if(!O.empty()&?¢re==O.front()){
      |                           ^
a.cc:29:28: error: '\U000000a2re' was not declared in this scope
   29 |             if(!O.empty()&?¢re==O.front()){
      |                            ^~~
a.cc:29:42: error: expected ':' before ')' token
   29 |             if(!O.empty()&?¢re==O.front()){
      |                                          ^
      |                                          :
a.cc:29:42: error: expected primary-expression before ')' token
Language: C++

    while(!Q.empty()){
      u = Q.front();
      Q.pop();

      if(u.n1 == str.size() && u.n2 == str2.size()){
	ans = u.right;
	break;
      }

      if(u.n1 < str.size()){
	v = u;
	v.down += v.c;
	v.c = str[v.n1++];
	for(i=0;i<v.down.size();i++){
	  if(v.down[i] != str3[i]) break;
	}
	if(i == v.down.size()) Q.push(v);
      }

      if(u.n2 < str2.size()){
	v = u;
	v.right += v.c;
        v.c = str2[v.n2++];
	Q.push(v);
      }
    }

Compiler output:
a.cc:1:5: error: expected unqualified-id before 'while'
    1 |     while(!Q.empty()){
      |     ^~~~~
Language: Java

import java.util.Scanner;

public class Main {
	Scanner sc = new Scanner(System.in);

	// Tree := (Tree Tree) | Leaf
	String t;
	int idx;
	int nidx;
	int ls[];
	int n;
	int ps[];
	Tree T;

	Tree tree() {
		if (t.charAt(idx) >= '0' && t.charAt(idx) <= '9') {
			int v = t.charAt(idx) - '0';
			idx++;
			return new Tree(v);
		}
		if (t.charAt(idx) == '(')
			idx++;
		Tree l = tree();
		idx++;
		Tree r = tree();
		if (t.charAt(idx) == ')')
			idx++;
		return new Tree(l, r);
	}

	void run() {
		while (true) {
			t = sc.nextLine();
			if (t.equals("END"))
				break;
			idx = 0;
			n = sc.nextInt();
			ls = new int[n];
			for (int i = 0; i < n; i++) {
				int a = sc.nextInt();
				int b = sc.nextInt();
				int c = sc.nextInt();
				int d = sc.nextInt();
				ls[i] = (a << 3) + (b << 2) + (c << 1) + d;
			}
			sc.nextLine();
			ps = new int[n - 1];
			T = tree();
			System.out.println(solve(0));
		}
	}

	int solve(int k) {
		int res = 0;
		if (k == n - 1) {
			nidx = 0;
			int set = check(T);
			if (set == 15)
				return 1;
			else
				return 0;
		}
		for (int i = 0; i < 3; i++) {
			ps[k] = i;
			res += solve(k + 1);
		}
		return res;
	}

	int check(Tree tr) throws Exception {
		if (tr.v > 0) {
			return ls[tr.v - 1];
		}
		Tree l = tr.l;
		Tree r = tr.r;
		int res = 0;
		if (n == 1) {
			throw new Exception("tr.v: " + tr.v);
		}
		switch (ps[nidx++]) {
		case 0:
			res = check(l) & check(r);
			break;
		case 1:
			res = check(l) | check(r);
			break;
		case 2:
			res = check(l) ^ check(r);
			break;
		}
		return res;
	}

	public static void main(String[] args) {
		new Main().run();
	}

}

class Tree {
	Tree l;
	Tree r;
	int v;

	Tree(Tree l, Tree r) {
		this.l = l;
		this.r = r;
		v = -1;
	}

	Tree(int v) {
		this.v = v;
	}

	public String toString() {
		if (v < 0) {
			return "(" + l.toString() + " " + r.toString() + ")";
		}
		return v + "";
	}
}

Compiler output:
Main.java:57: error: unreported exception Exception; must be caught or declared to be thrown
			int set = check(T);
			               ^
1 error
Language: C++

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

int curPos = 0;
string str;
int info[128] = {};
vector< vector<int> > g;
int number[128] = {};
int mx = 0;
void parse(int pos){
	//cout << curPos << " " << str[curPos] << endl;
	mx = max(pos,mx);
	if( str[curPos] >= '0' && str[curPos] <= '9'){
		number[pos] = info[ str[curPos] - '0' - 1];
		curPos++;
		return;
	}
	
	assert(str[curPos] == '(');
	curPos++;
	g[pos].push_back(pos*2+1);
	parse(pos*2+1);
	
	assert(str[curPos] == ' ');
	curPos++; // space 
	
	
	g[pos].push_back(pos*2+2);
	parse(pos*2+2);
	assert(str[curPos] == ')');
	curPos++;
	return;
}

int calc(int a,int b,int t){
	if( t == 0 ) return a & b;
	if( t == 1 ) return a | b;
	return a^b;
}

int tmp[30] = {};

vector<int> all(int pos){
	if( number[pos] >= 0 ){
		vector<int> c(16);
		c[number[pos]] = 1;
		//cout << pos << " : ";
		//for(int i = 0 ; i < 16 ; i++) cout << c[i] << " "; cout << endl;
		return c;
	}else{
		vector<int> a,b,c(16);
		a = all(pos*2+1);
		b = all(pos*2+2);
		for(int k = 0 ; k < 3 ; k++){
			for(int i = 0 ; i < 16 ; i++){
				for(int j = 0 ; j < 16 ; j++){
					c[calc(i,j,k)] += a[i] * b[j];
				}
			}
		}
		//cout << pos << " : ";
		//for(int i = 0 ; i < 16 ; i++) cout << c[i] << " "; cout << endl;
		return c;
	}
}

int main(){
	int n;
	while(1){
			while( getline(cin,str) && (str == "" || str == "END") ){ if(str == "END") return 0; }
		for(int i = 0 ; i < 128 ; i++) number[i] = -1;
		cin >> n;
		g.clear();
		g.resize(128);
		for(int i = 0 ; i < n ; i++){
			int inf = 0 , a;
			for(int j = 0 ; j < 4 ; j++){
				cin >> a;
				inf |= (a<<j);
			}
			info[i] = inf;
		}
		str += "~";
		curPos = 0;
		mx = 0;
		parse(0);
		assert(str[curPos] == '~');
		/*for(int i = 0 ; i <= mx ; i++){
			cout << i << "(" << number[i] << ")" << " : ";
			for(int j =0 ; j < g[i].size() ; j++) cout << g[i][j] << " ";
			cout << endl;
		}*/
		vector<int> answer = all(0);
		cout << answer[15] << endl;
	}
}

Compiler output:
a.cc: In function 'void parse(int)':
a.cc:20:9: error: 'assert' was not declared in this scope
   20 |         assert(str[curPos] == '(');
      |         ^~~~~~
a.cc:3:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    2 | #include <vector>
  +++ |+#include <cassert>
    3 | using namespace std;
a.cc: In function 'int main()':
a.cc:88:17: error: 'assert' was not declared in this scope
   88 |                 assert(str[curPos] == '~');
      |                 ^~~~~~
a.cc:88:17: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
Language: C++

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

const int W = 12,H = 12;

int visited[H][W];
bool visnode[6];
int in[H][W];
int inx[7],iny[7];
int dx[]={0,0,1,-1};
int dy[]={1,-1,0,0};

bool dfs(int n,int now,int cnt,int limit,int y,int x,int r,int c){
  //cout << y << " " << x << " " << now << " " << cnt << " " << limit << endl;
  if (now == n)return true;


  if (visnode[now]){
    if (dfs(n,now+1,cnt,limit,iny[now+1],inx[now+1],r,c))return true;
    return false;
  }

  if (cnt >limit)return false;  

  if (visited[y][x] != -1){
    if (now == 0){
      if (in[y][x] != 0){
	visnode[in[y][x]]=true;
	if (dfs(n,now+1,cnt,limit,iny[in[y][x]],inx[in[y][x]],r,c))return true;
	visnode[in[y][x]]=false;
	return false;
      }else if (visited[y][x] == 0){
	if (cnt == 1);
	else return false;
      }else assert(false);
    }else {
      if (in[y][x] == now);
      else if (visited[y][x] == now)return false;
      else if (visited[y][x] < now){
	if (dfs(n,now+1,cnt,limit,iny[now+1],inx[now+1],r,c))return true;
	else return false;
      }
    }
  }




  visited[y][x]=now;
  
  rep(i,4){
    int nex = x+dx[i],ney = y+dy[i];
    if (nex<0||c-1 < nex || r-1 < ney || ney < 0)continue;  
    if (dfs(n,now,cnt+1,limit,ney,nex,r,c))return true;
  }
  visited[y][x]=-1;
  return false;
}


main(){
  int r,c;
  while(cin>>r>>c && r){
    int index = 0;
    rep(i,r){
      rep(j,c){
	cin>>in[i][j];
	if (in[i][j] == 0)in[i][j]=-1;
	else inx[index]=j,iny[index]=i,visnode[index]=false,in[i][j]=index++;
      }
    }


    if (index == 1){
      cout << r*c-1 << endl;
      continue;
    }
    

    rep(k,r*c+1){
      rep(i,r)rep(j,c){
	visited[i][j]=in[i][j];
      }
      if (dfs(index,0,1,k,iny[0],inx[0],r,c)){
	cout << r*c-k << endl;
	break;
      }
    }
    //puts("iterative deeping end");
  }
}

Compiler output:
a.cc: In function 'bool dfs(int, int, int, int, int, int, int, int)':
a.cc:37:13: error: 'assert' was not declared in this scope
   37 |       }else assert(false);
      |             ^~~~~~
a.cc:2:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    1 | #include<iostream>
  +++ |+#include <cassert>
    2 | using namespace std;
a.cc: At global scope:
a.cc:63:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   63 | main(){
      | ^~~~
Language: C++

1 1
1

1 2
1 1


3 3
1 0 0
0 0 0
1 0 0

3 3
1 0 0
1 0 0
1 0 0

3 3
1 1 1
0 0 0
0 0 0



4 4
1 0 0 0
0 0 1 0
0 1 0 0
1 0 0 1



1 1
1


2 3
1 0 0
0 0 1


12 12
1 0 0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 1

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 1 1
      | ^
Language: C

#include <stdio.h>

int main(void)
{
	int n;
	
	while (scnaf("%d", &n) * n != 0){
		int sum = 0;
		
		n /= 4;
		while (n-- > 0){
			int t;
			
			scanf("%d", &t);
			sum += t;
		}
		printf("%d\n", sum);
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:16: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |         while (scnaf("%d", &n) * n != 0){
      |                ^~~~~
      |                scanf
Language: C

#include<stdio.h>
int main()
{
  int n,t[100000],k,s;
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    s=0;
    for(k=0;k<(n/4);k++){
      scanf("%d",&t[k]);
      s=s+t[k];
    }
    printf("%d\n",s);
  }

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

#include <stdio.h>

int main(void)
{
	int n;
	int sum=0,a;
	
	while(scanf("%d",&n)&&n!=0){
		for(i=0;i<n/4;i++){
			scanf("%d",&a);
			sum+=a;
		}
		printf("%d\n",sum);
		sum=0;
	}
	return 0 ;
}

Compiler output:
main.c: In function 'main':
main.c:9:21: error: 'i' undeclared (first use in this function)
    9 |                 for(i=0;i<n/4;i++){
      |                     ^
main.c:9:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C

main(l.h.a){for(;scanf("%d",&l),l;printf("%d",h))for(h=0;l>1;l=l-4,h+=a)scanf("%d",a);}

Compiler output:
main.c:1:7: error: expected ')' before '.' token
    1 | main(l.h.a){for(;scanf("%d",&l),l;printf("%d",h))for(h=0;l>1;l=l-4,h+=a)scanf("%d",a);}
      |       ^
      |       )
Language: C++

#include<stdio.h>

int main(){

int n;
int x,s=0;

while(1){
scanf("%d",&n);

for(int i=0;i<n/4;i++)
{scanf("%d",&x);
sum+=x;}

printf("%d\n",s);
s=0;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:1: error: 'sum' was not declared in this scope
   13 | sum+=x;}
      | ^~~
Language: C++


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


class Main{
	public static void main(String[] args){
		Solve s = new Solve();
		s.solve();
	}	
}

class Solve{
	Solve(){}
	

	void solve(){
		Scanner in = new Scanner(System.in);

		while(in.hasNext()) {
			int n = in.nextInt() / 4;
			if (n == 0) return;
			int sum = 0;
			for(int i = 0; i < n; i++){
				int t = in.nextInt();
				sum += t;
			}
			System.out.println(sum);
		}
		
	}
}

Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.ArrayList;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.util.Stack;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:15: error: expected ':' before 'static'
    8 |         public static void main(String[] args){
      |               ^~~~~~~
      |               :
a.cc:8:33: error: 'String' has not been declared
    8 |         public static void main(String[] args){
      |                                 ^~~~~~
a.cc:8:42: error: expected ',' or '...' before 'args'
    8 |         public static void main(String[] args){
      |                                          ^~~~
a.cc:12:2: error: expected ';' after class definition
   12 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:9:17: error: 'Solve' was not declared in this scope
    9 |                 Solve s = new Solve();
      |                 ^~~~~
a.cc:10:17: error: 's' was not declared in this scope
   10 |                 s.solve();
      |                 ^
a.cc: At global scope:
a.cc:33:2: error: expected ';' after class definition
   33 | }
      |  ^
      |  ;
a.cc: In member function 'void Solve::solve()':
a.cc:19:17: error: 'Scanner' was not declared in this scope
   19 |                 Scanner in = new Scanner(System.in);
      |                 ^~~~~~~
a.cc:21:23: error: 'in' was not declared in this scope; did you mean 'int'?
   21 |                 while(in.hasNext()) {
      |                       ^~
      |                       int
a.cc:29:25: error: 'System' was not declared in this scope
   29 |                         System.out.println(sum);
      |                         ^~~~~~
Language: C++

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

public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int num;
			while ((num = Integer.parseInt(br.readLine())) != 0) {
				int total = 0;
				for (int i = 0; i < num; i = i + 4) {
					int hit = Integer.parseInt(br.readLine());
					total += hit;
				}
				System.out.println(total);
			}
		} catch (Exception e) {
			System.out.println(e);
		}
	}
}



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

#include<stdio.h>
main(n,k,s){for(;scanf("%d",&n),s=0,n;){for(;n>0;n-=4)scanf("%d",&k),s+=k;printf("%d\n",s);}}

Compiler output:
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token
    2 | main(n,k,s){for(;scanf("%d",&n),s=0,n;){for(;n>0;n-=4)scanf("%d",&k),s+=k;printf("%d\n",s);}}
      |     ^
Language: C++

#include <iostream>
using namespace std;

int main(){
	
	int i,n,utu,ans=0;
	
	while(cin >> n,n){
		for(i=0;i<n/4;i++){
			cin >> utu;
			
			ans += utu
		}
		
		cout << ans << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:35: error: expected ';' before '}' token
   12 |                         ans += utu
      |                                   ^
      |                                   ;
   13 |                 }
      |                 ~
Language: C++

i,a;main(n){for(;scanf("%d",&n),n;a=!printf("%d\n",a))for(;scanf("%d",&i),a+=i,n-=4;);}

Compiler output:
a.cc:1:1: error: 'i' does not name a type
    1 | i,a;main(n){for(;scanf("%d",&n),n;a=!printf("%d\n",a))for(;scanf("%d",&i),a+=i,n-=4;);}
      | ^
a.cc:1:9: error: expected constructor, destructor, or type conversion before '(' token
    1 | i,a;main(n){for(;scanf("%d",&n),n;a=!printf("%d\n",a))for(;scanf("%d",&i),a+=i,n-=4;);}
      |         ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
 int n;
 for(cin>>n,n)
{
  int sum=0;
for(;;n=n/5)
{
int tmp;
cin>>tmp;
sum+=tmp;
}
cout<<sum<<endl;
}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: expected ';' before ')' token
    6 |  for(cin>>n,n)
      |              ^
      |              ;
a.cc:18:1: error: expected primary-expression before '}' token
   18 | }
      | ^
a.cc:16:2: error: expected ';' before '}' token
   16 | }
      |  ^
      |  ;
   17 | 
   18 | }
      | ~ 
a.cc:18:1: error: expected primary-expression before '}' token
   18 | }
      | ^
a.cc:16:2: error: expected ')' before '}' token
   16 | }
      |  ^
      |  )
   17 | 
   18 | }
      | ~ 
a.cc:6:5: note: to match this '('
    6 |  for(cin>>n,n)
      |     ^
a.cc:18:1: error: expected primary-expression before '}' token
   18 | }
      | ^
Language: Java

import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		while (true) {
			String str = sc.nextLine();
			if (str.equals("END OF INPUT")) break;
			String[] strs = str.split(" ");
			for (int i = 0; i < strs.length; i++) {
				out.print(strs[i].length());
			}
			out.println();
		}
		out.flush();
		sc.close();
	}
	

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

import java.util.Scanner;

public class p1042{
	public p1042(){
		Scanner sc = new Scanner(System.in);
		while(true){
			String str = sc.nextLine();
			if(str.equals("END OF INPUT")){
				break;
			}
			
			String[] s = str.split(" ");
			
			for(String st: s){
				System.out.print(st.length());
			}
			System.out.println();
		}
	}
	
	public static void main(String[] args){
		p1042 test = new p1042();
	}
}

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

import java.util.Scanner;

public class p1042{
	public p1042(){
		Scanner sc = new Scanner(System.in);
		while(true){
			String str = sc.nextLine();
			if(str.equals("END OF INPUT")){
				break;
			}
			
			str.replaceAll("  ", " sasami ");
			System.out.println(str);
			String[] s = str.split(" ");
			
			for(String st: s){
				if(st.equals("sasami")){
					System.out.print("0");
				} else {
					System.out.print(st.length());
				}
			}
			System.out.println();
		}
	}
	
	public static void main(String[] args){
		p1042 test = new p1042();
	}
}

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

import java.util.*;
import java.util.regex.*;


public class AOJ1042 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.useDelimiter("\n");
		
		while (true) {
			String s = sc.next();
			if (s.equals("END OF INPUT")) {
				break;
			}
			Matcher m = Pattern.compile("\\w+").matcher(s);
			
			while (m.find()) {
				System.out.print(m.group().length());
			}
			System.out.println("");
			
		}
	}

}

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

char *p,s[999];
main(i){
  for(;gets(s),strcmp(p=s,"END OF INPUT");puts(""))
    for(strcat(s," ");*p;printf("%d",i))
      for(i=0;*p++!=' ';i++);
}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(i){
      | ^~~~
main.c: In function 'main':
main.c:2:1: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:3:8: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    3 |   for(;gets(s),strcmp(p=s,"END OF INPUT");puts(""))
      |        ^~~~
main.c:3:16: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
    3 |   for(;gets(s),strcmp(p=s,"END OF INPUT");puts(""))
      |                ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strcmp'
  +++ |+#include <string.h>
    1 | char *p,s[999];
main.c:3:43: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    3 |   for(;gets(s),strcmp(p=s,"END OF INPUT");puts(""))
      |                                           ^~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'puts'
  +++ |+#include <stdio.h>
    1 | char *p,s[999];
main.c:4:9: error: implicit declaration of function 'strcat' [-Wimplicit-function-declaration]
    4 |     for(strcat(s," ");*p;printf("%d",i))
      |         ^~~~~~
main.c:4:9: note: include '<string.h>' or provide a declaration of 'strcat'
main.c:4:9: warning: incompatible implicit declaration of built-in function 'strcat' [-Wbuiltin-declaration-mismatch]
main.c:4:9: note: include '<string.h>' or provide a declaration of 'strcat'
main.c:4:26: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    4 |     for(strcat(s," ");*p;printf("%d",i))
      |                          ^~~~~~
main.c:4:26: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:4:26: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:4:26: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
#include<string.h>
int main(){
	int h,i,pre;
	char s[2000];
	while(1){
		gets(s);
		if(strcmp("END OF INPUT",s)==0)
		break;
		
		pre=0;
		
		h=strlen(s);
		for(i=0;i<h+1;i++){
			if(s[i]==' '){
					printf("%d",i-pre);
					pre=i+1;
					if(s[i+1]==' '){
					printf("0");
					i++;
					pre++;
				}
			}
			else if(s[i]=='\0'){
				printf("%d",i-pre);
				break;
			}
		}
		printf("\n");
		
	}
	
	
	
	
	
	return 0;
}

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

c;
int main(i)
{
  char s[999];
  for(;;printf("%d\n",c-1))
    {
      fgets(s,999,stdin); 
      if(!strcmp(s,"END OF INPUT"))
	exit(0);
      for(c=i=0;s[i]!='\0';c++)
	if(s[i++]==' ')
	  printf("%d",c),c=-1;
      
    }
  
}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | c;
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
main.c: In function 'main':
main.c:2:5: error: type of 'i' defaults to 'int' [-Wimplicit-int]
    2 | int main(i)
      |     ^~~~
main.c:5:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    5 |   for(;;printf("%d\n",c-1))
      |         ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | c;
main.c:5:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    5 |   for(;;printf("%d\n",c-1))
      |         ^~~~~~
main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:7:7: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
    7 |       fgets(s,999,stdin);
      |       ^~~~~
main.c:7:19: error: 'stdin' undeclared (first use in this function)
    7 |       fgets(s,999,stdin);
      |                   ^~~~~
main.c:7:19: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:7:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:11: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
    8 |       if(!strcmp(s,"END OF INPUT"))
      |           ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strcmp'
  +++ |+#include <string.h>
    1 | c;
main.c:9:9: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
    9 |         exit(0);
      |         ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | c;
main.c:9:9: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
    9 |         exit(0);
      |         ^~~~
main.c:9:9: note: include '<stdlib.h>' or provide a declaration of 'exit'
Language: C


c;
main(i)
{
  char s[99];
  for(;fgets(s,99,stdin),c=i=!strstr(s,"END OF INPUT");printf("%d\n",c-1))
      for(;s[i]!=0;)
	c=s[i++]-32?c+1:!printf("%d",c);
  
}

Compiler output:
main.c:2:1: warning: data definition has no type or storage class
    2 | c;
      | ^
main.c:2:1: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(i)
      | ^~~~
main.c: In function 'main':
main.c:3:1: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:6:8: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
    6 |   for(;fgets(s,99,stdin),c=i=!strstr(s,"END OF INPUT");printf("%d\n",c-1))
      |        ^~~~~
main.c:6:19: error: 'stdin' undeclared (first use in this function)
    6 |   for(;fgets(s,99,stdin),c=i=!strstr(s,"END OF INPUT");printf("%d\n",c-1))
      |                   ^~~~~
main.c:1:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
  +++ |+#include <stdio.h>
    1 | 
main.c:6:19: note: each undeclared identifier is reported only once for each function it appears in
    6 |   for(;fgets(s,99,stdin),c=i=!strstr(s,"END OF INPUT");printf("%d\n",c-1))
      |                   ^~~~~
main.c:6:31: error: implicit declaration of function 'strstr' [-Wimplicit-function-declaration]
    6 |   for(;fgets(s,99,stdin),c=i=!strstr(s,"END OF INPUT");printf("%d\n",c-1))
      |                               ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strstr'
  +++ |+#include <string.h>
    1 | 
main.c:6:31: warning: incompatible implicit declaration of built-in function 'strstr' [-Wbuiltin-declaration-mismatch]
    6 |   for(;fgets(s,99,stdin),c=i=!strstr(s,"END OF INPUT");printf("%d\n",c-1))
      |                               ^~~~~~
main.c:6:31: note: include '<string.h>' or provide a declaration of 'strstr'
main.c:6:56: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    6 |   for(;fgets(s,99,stdin),c=i=!strstr(s,"END OF INPUT");printf("%d\n",c-1))
      |                                                        ^~~~~~
main.c:6:56: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:6:56: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:6:56: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>c;main(i){char s[99];for(;fgets(s,99,stdin),c=i=!strstr(s,"END OF INPUT");printf("%d\n",c-1))for(;s[i];)c=s[i++]-32?c+1:!printf("%d",c);}

Compiler output:
main.c:1:19: warning: extra tokens at end of #include directive
    1 | #include <stdio.h>c;main(i){char s[99];for(;fgets(s,99,stdin),c=i=!strstr(s,"END OF INPUT");printf("%d\n",c-1))for(;s[i];)c=s[i++]-32?c+1:!printf("%d",c);}
      |                   ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

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

char s[16];
int main(void){
	clock_t c1 = clock();
	int cnt = 0;

	for(; scanf("%s", s) != EOF ){
		if( strcmp(s, "END") == 0 )
			++cnt;
	}
	
	clock_t c2 = c1 + CLOCKS_PER_SEC * 0.02 * cnt;
	while( c2 > clock() );
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:37: error: expected ';' before ')' token
   10 |         for(; scanf("%s", s) != EOF ){
      |                                     ^
Language: C

#include<stdio.h>
#include<string.h>
char str[1000000],buf[10];
int t,i;
int main()
{
	for(;gets(str),!strstr(str,"END OF INPUT");)
	{
		for(i=t=0;str[i];i++)
		{
			for(;str[i]&&str[i]!=' ';i++);
			if(t!=i)
				printf("%d",i-t);
			t=i;
			for(;str[i]&&str[i]==' ';i++);
			if(i-t>1)
				for(int j=0;j<i-t;j++)
					putchar('0');
			t=i;
		}
		memset(str,0,sizeof(str));
		puts("");
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:14: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    7 |         for(;gets(str),!strstr(str,"END OF INPUT");)
      |              ^~~~
      |              fgets
Language: C

#include<stdio.h>
#include<string.h>
char str[1000000],buf[10];
int t,i,j;
int main()
{
	for(;gets(str),!strstr(str,"END OF INPUT");)
	{
		for(i=t=0;str[i];i++)
		{
			for(;str[i]&&str[i]!=' ';i++);
			if(t!=i)
				printf("%d",i-t);
			t=i;
			for(;str[i]&&str[i]==' ';i++);
			if(i-t>1)
				for(int j=0;j<i-t;j++)
					putchar('0');
			t=i;
		}
		memset(str,0,sizeof(str));
		puts("");
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:14: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    7 |         for(;gets(str),!strstr(str,"END OF INPUT");)
      |              ^~~~
      |              fgets
Language: C++

#include <iostream>

using namespace std;

int main(){
    string a;
    while (getline(cin,a)&&a!="END OF INPUT"){
        int num=0;
        for(int i=0;i<a.length();++i){
            if(a[i]==" ") cout << num,num=0;
            else num++;
        }
        cout << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |             if(a[i]==" ") cout << num,num=0;
Language: C++

#include <iostream>

using namespace std;

int main(){
    string a;
    while (getline(cin,a)&&a!="END OF INPUT"){
        int num=0;
        for(int i=0;i<a.length();++i){
            if(a[i]==" ") {
                cout << num;
                num=0;
            }else num++;
        }
        cout << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |             if(a[i]==" ") {
Language: C++

#include <iostream>

using namespace std;

int main(){
    string a;
    while (getline(cin,a)&&a!="END OF INPUT"){
        int num=0;
        for(int i=0;i<a.length();++i){
            if(*a[i]==" ") {
                cout << num;
                num=0;
            }else num++;
        }
        cout << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: invalid type argument of unary '*' (have '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
   10 |             if(*a[i]==" ") {
Language: C++

#include <iostream>

using namespace std;

int main(){
    string a;
    while (getline(cin,a)&&a!="END OF INPUT"){
        int num=0;
        for(int i=0;i<a.length();++i){
            if(a[i]==" ") {
                cout << num;
                num=0;
            }else num++;
        }
        cout << cnt << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |             if(a[i]==" ") {
a.cc:15:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   15 |         cout << cnt << endl;
      |                 ^~~
      |                 int
Language: C++

#include <iostream>

using namespace std;

int main(){
    string a;
    while (getline(cin,a)&&a!="END OF INPUT"){
        int num=0;
        for(int i=0;i<a.length();++i){
            if(a[i]==' ') {
                cout << num;
                num=0;
            }else num++;
        }
        cout << cnt << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   15 |         cout << cnt << endl;
      |                 ^~~
      |                 int