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

#include<map>
#include<list>
#include<stack>
#include<queue>
#include<cmath>
#include<string>
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<conio.h>
using namespace std;

int tmap[12][12];

void Terrain(int i,int l){

	if (i<0 || i>11 || l<0 || i>11 || tmap[i][l] == 0){
		return;
	}
	tmap[i][l] = 0;

	Terrain(i + 1, l);
	Terrain(i - 1, l);
	Terrain(i, l + 1);
	Terrain(i, l - 1);

}
int a;
int main(){
	int cunt = 0;
	while (1){
		for (int i = 0; i < 12; i++){
			for (int l = 0; l < 12; l++){
				scanf("%1d", &tmap[i][l])
			}
		}
		for (int i = 0; i < 12; i++){
			for (int l = 0; l < 12; l++){
				if (tmap[i][l] == 1){
					Terrain(i, l);
					cunt++;
				}
			}
		}
		cout << cunt << endl;
		cunt = 0;
	}
	
	return 0;
}

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

#include<map>
#include<list>
#include<stack>
#include<queue>
#include<cmath>
#include<string>
#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;

int tmap[12][12];

void Terrain(int i,int l){

	if (i<0 || i>11 || l<0 || i>11 || tmap[i][l] == 0){
		return;
	}
	tmap[i][l] = 0;

	Terrain(i + 1, l);
	Terrain(i - 1, l);
	Terrain(i, l + 1);
	Terrain(i, l - 1);

}
int a;
int main(){
	int cunt = 0;
	while (1){
		for (int i = 0; i < 12; i++){
			for (int l = 0; l < 12; l++){
				scanf("%1d", &tmap[i][l])
			}
		}
		for (int i = 0; i < 12; i++){
			for (int l = 0; l < 12; l++){
				if (tmap[i][l] == 1){
					Terrain(i, l);
					cunt++;
				}
			}
		}
		cout << cunt << endl;
		cunt = 0;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:58: error: expected ';' before '}' token
   33 |                                 scanf("%1d", &tmap[i][l])
      |                                                          ^
      |                                                          ;
   34 |                         }
      |                         ~
Language: C++

#include<map>
#include<list>
#include<stack>
#include<queue>
#include<cmath>
#include<string>
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<conio.h>
using namespace std;

int tmap[12][12];

void Terrain(int i,int l){

	if (i<0 || i>11 || l<0 || i>11 || tmap[i][l] == 0){
		return;
	}
	tmap[i][l] = 0;

	Terrain(i + 1, l);
	Terrain(i - 1, l);
	Terrain(i, l + 1);
	Terrain(i, l - 1);

}
int a;
int main(){
	int cunt = 0;
	while (1){
		for (int i = 0; i < 12; i++){
			for (int l = 0; l < 12; l++){
				scanf("%1d", &tmap[i][l]);
			}
		}
		for (int i = 0; i < 12; i++){
			for (int l = 0; l < 12; l++){
				if (tmap[i][l] == 1){
					Terrain(i, l);
					cunt++;
				}
			}
		}
		cout << cunt << endl;
		cunt = 0;
	}
	return 0;
}

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

#include<map>
#include<list>
#include<stack>
#include<queue>
#include<cmath>
#include<string>
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<conio.h>
using namespace std;

char tmap[12][12];

void Terrain(int i,int l){

	if (i<0 || i>11 || l<0 || i>11 || tmap[i][l] == '0'){
		return;
	}
	tmap[i][l] = 0;

	Terrain(i + 1, l);
	Terrain(i - 1, l);
	Terrain(i, l + 1);
	Terrain(i, l - 1);

}
int a;
int main(){
	int cunt = 0;
	while (cin >> tmap[0]){
		for (int i = 1; i < 12; i++) cin >> tmap[i];
		for (int i = 0; i < 12; i++){
			for (int l = 0; l < 12; l++){
				if (tmap[i][l] == '1'){
					Terrain(i, l);
					cunt++;
				}
			}
		}
		cout << cunt << endl;
		cunt = 0;
	}
	return 0;
}

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

#include<map>
#include<list>
#include<stack>
#include<queue>
#include<cmath>
#include<string>
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<conio.h>
using namespace std;

char tmap[12][12];

void Terrain(int i,int l){

	if (i<0 || i>11 || l<0 || i>11 || tmap[i][l] == '0'){
		return;
	}

	tmap[i][l] = '0';


	Terrain(i + 1, l);
	Terrain(i - 1, l);
	Terrain(i, l + 1);
	Terrain(i, l - 1);

}
int main(){
	int cunt = 0;
	while (cin >> tmap[0]){
		for (int i = 1; i < 12; i++) cin >> tmap[i];
		for (int i = 0; i < 12; i++){
			for (int l = 0; l < 12; l++){
				if (tmap[i][l] == '1'){
					Terrain(i, l);
					cunt++;
				}
			}
		}
		cout << cunt << endl;
		cunt = 0;
	}
	return 0;
}

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

#include<map>
#include<list>
#include<stack>
#include<queue>
#include<cmath>
#include<string>
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<conio.h>
using namespace std;

char tmap[12][12];
int c;

void Terrain(int i,int l){

	tmap[i][l] = '0';
	if (tmap[i + 1][l] == '1'){
		Terrain(i + 1, l);
	}
	if (tmap[i - 1][l] == '1'){
		Terrain(i - 1, l);
	}
	if (tmap[i][l + 1] == '1'){
		Terrain(i, l + 1);
	}
	if (tmap[i][l - 1] == '1'){
		Terrain(i, l - 1);
	}

	return;

}
int main(){
	int cunt = 0;
	while (cin >> tmap[0]){
		for (int i = 1; i < 12; i++) cin >> tmap[i];
		for (int i = 0; i < 12; i++){
			for (int l = 0; l < 12; l++){
				if (tmap[i][l] == '1'){
					Terrain(i, l);
					cunt++;
				}
			}
		}
		cout << cunt << endl;
		cunt = 0;
	}
	return 0;
}

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

#include<map>
#include<list>
#include<stack>
#include<queue>
#include<cmath>
#include<string>
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<conio.h>
using namespace std;

char tmap[12][12];
int c;

void Terrain(int i,int l){

	if (tmap[i][l] == '0'||i < 0 || i > 11 || l < 0 || l > 11) return;

	tmap[i][l] = '0';

	Terrain(i + 1, l);
	Terrain(i - 1, l);
	Terrain(i, l + 1);
	Terrain(i, l - 1);

	return;

}
int main(){
	int cunt = 0;
	while (cin >> tmap[0]){
		for (int i = 1; i < 12; i++) cin >> tmap[i];
		for (int i = 0; i < 12; i++){
			for (int l = 0; l < 12; l++){
				if (tmap[i][l] == '1'){
					Terrain(i, l);
					cunt++;
				}
			}
		}
		cout << cunt << endl;
		cunt = 0;
	}
	return 0;
}

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

#include<stdio.h>
char Island[12][12];
void CC(int,int);
//void show(void);
int main(void)
{
	int c=0;
	while(1){
	for(int i=0;i<12;i++){
		if(scanf("%s",Island[i])==EOF) break;
	}
	
	for(int i=0;i<12;i++){
		for(int j=0;j<12;j++){
			if(Island[i][j] == '1'){
				//printf("x:%d y:%d @\n",j,i);
				CC(i,j);
				c++;
				//show();
			}
		}
	}
	printf("%d\n",c);
	return 0;
}

void CC(int y,int x)
{
	if(y>=0 && x>=0){
		//printf("delete x:%d y:%d\n",x,y);
		Island[y][x] = '0';
		if(Island[y-1][x] == '1') CC(y-1,x); //???
		if(Island[y+1][x] == '1') CC(y+1,x); //???
		if(Island[y][x-1] == '1') CC(y,x-1); //???
		if(Island[y][x+1] == '1') CC(y,x+1); //???
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:1: error: a function-definition is not allowed here before '{' token
   28 | {
      | ^
a.cc:37:2: error: expected '}' at end of input
   37 | }
      |  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++


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

int maze[12][12];
static const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };

void printTable(int a[12][12]) {
	for (int i = 0; i < 12; i++) {
		for (int j = 0; j < 12; j++) {
			cout << a[i][j];
		}
		cout << endl;
	}
}
void dfs(int y, int x) {
	maze[y][x] = 0;
	for (int i = 0; i < 4; i++) {
		if (0 <= dx[i] + x && dx[i] + x < 12 && 0 <= dy[i] + y && dy[i] + y < 12 && maze[y + dy[i]][x + dx[i]] == 1) {
			dfs(y + dy[i], x + dx[i]);
		}
	}
}


int main()
{
	string s;
	while (cin>>s) {
		memset(maze, 0, sizeof(maze));
		if (s.size() == 0)break;//if(cin.eof())break;
		//1 line 
		for (int i = 0; i < 12; i++) {
			maze[0][i] = s[i] - '0';
		}
		//2-12 line
		for (int i = 1; i < 12; i++) {
			cin >> s;
			for (int j = 0; j < 12; j++) {
				maze[i][j] = s[j] - '0';
			}
		}
		int ans = 0;
		//cout << "=======dfs???=======" << endl;
		//printTable(maze);
		//cout << "===================" << endl;
		//dfs
		for (int y = 0; y < 12; y++) {
			for (int x = 0; x < 12; x++) {
				if (maze[y][x] == 1) {
					dfs(y, x);
					ans++;
				}
			}
		}
		cout << ans << endl;
		//cout << "=======dfs???=======" << endl;
		//printTable(maze);
		//cout << "===================" << endl;
	}



	return 0;
}

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

#include <iostream>
#include <queue>
#include <vector>
#include <map>

#define COL 12
#define ROW 12
using namespace std;

int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};

bool input(vector< vector<char> > &m);
void delete_island(vector< vector< char > > &m, int x, int y);


int main(){
  vector< vector< char > > m(COL+2, vector<char>(ROW+2, '0'));
  
  while(input(m)){
    int island = 0;
    for(int y = 0; y < m.size(); y++){
      for(int x = 0; x < m[y].size(); x++){
	if(m[y][x] == '1'){
	  delete_island(m,x,y);
	  island++;
	  }
	}
      }
    }
    cout << island << endl;
  }
}

bool input(vector< vector<char> > &m){
  for(int y = 0; y < m.size(); y++){
    for(int x = 0; x < m[y].size(); x++){
      if(y == 0 || x == 0 ||
	 y == m.size()-1 || x == m.size()-1){
	m[y][x] = '0';
      }else{
	if(!(cin >> m[y][x])) return false;
      }
    }
  }
  return true;
}


 void delete_island(vector< vector< char > > &m, int x, int y){
   queue< pair< int, int > > q;
   q.push(make_pair(x,y));

   while(!(q.empty())){
     pair<int, int> cur = q.front();
     q.pop();
     if(m[cur.second][cur.first] == '1'){
       m[cur.second][cur.first] = '0';
       for(int i = 0; i < 4; i++){
	 q.push(make_pair(cur.first+dx[i],cur.second+dy[i]));
       }
     }
   }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:13: error: 'island' was not declared in this scope; did you mean 'srand'?
   31 |     cout << island << endl;
      |             ^~~~~~
      |             srand
a.cc: At global scope:
a.cc:33:1: error: expected declaration before '}' token
   33 | }
      | ^
Language: C++

#include <iostream>

using namespace std;

const int N=12;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
    char grid[12][12];

void dfs(char x,char y);

int main(){

    while(1){

        int count=0;


        for(int y=0;y<N;y++){{
            for(int x=0;x<N;x++){
                cin>>grid[y];
                }
            }
        }


        for(int y=0;y<N;y++){
            for(int x=0;x<N;x++){
                if(grid[y][x]=='1'){
                    count++;
                    dfs(x,y);
                    
                }
            }
        }

        cout<<count<<endl;
    }

    return 0;
}


void dfs(int x,int y){

    grid[y][x]='0';
    for(int i=0;i<4;i++){
        int mx=x+dx[i];
        int my=y+dy[i];
        if(mx<0||my<0||N<=mx||N<=my)continue;
        if(grid[mx][my]=='0')continue;
        dfs(my,mx);

    }
}

Compiler output:
/usr/bin/ld: /tmp/ccJ6Ue54.o: in function `main':
a.cc:(.text+0xb9): undefined reference to `dfs(char, char)'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<vector>
#include<cstdio>
#include<algorithm>
#include<queue>
#define REP(i,n) for(int i=0;i<(n);i++)
typedef vector<int> vec;
typedef vector<vec> mat;
typedef long long int ll;
int dy[4] = { 1,0,-1,0 }, dx[4] = { 0,1,0,-1 };
static const int INF = 1 << 21;
using namespace std;
int N, M;
char field[12][12];

void dfs(int x, int y) {
	int nx, ny;
	field[x][y] = 0;
	REP(i, 4) {
		nx = x + dx[i]; ny = y + dy[i];
		if (0 <= nx&&nx < 12 && 0 <= ny&&ny < 12 && field[nx][ny] == 1)dfs(nx, ny);
	
		
	}
}

void solve() {
	int res;
	REP(i, 12) {
		REP(j, 12) {
			if (field[i][j] == 1) {
				dfs(i, j);
					res++;
			}
		}
	}
	cout << res << endl;
}

int main() {
	REP(i, 12) {
		REP(j, 12) {
			cin >> field[i][j];
		}
	}
	solve();
	return 0;
}

Compiler output:
a.cc:7:9: error: 'vector' does not name a type
    7 | typedef vector<int> vec;
      |         ^~~~~~
a.cc:8:9: error: 'vector' does not name a type
    8 | typedef vector<vec> mat;
      |         ^~~~~~
Language: C++

#include <iostream>

using namespace std;
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
char field[12][12];
int W = 12;
int H = 12;

void DFS(int y, int x)
{
	field[y][x] = '0';
	for(int i = 0; i < 4; ++i)
	{
		int X = x + dx[i];
		int Y = y + dy[i];
		if((0 <= X && X < W && 0 <= Y && Y < H) && field[Y][X] == '1')
		{
			DFS(Y, X);
		}
	}
}

void solve()
{
	char a;
	while(cin >> a)
	{
		int count = 0;
		memset(field, 0, sizeof(field));
		field[0][0] = a;
		for(int i = 1; i < W; ++i)
		{
			cin >> field[0][i];
		}
		for(int i = 1; i < H; ++i)
		{
			for(int j = 0; j < W; ++j)
			{
				cin >> field[i][j];
			}
		}
		
		for(int i = 0; i < H; ++i)
		{
			for(int j = 0; j < W; ++j)
			{
				if(field[i][j] == '1')
				{
					DFS(i, j);
					count++;
				}
			}
		}
		cout << count << endl;
	}
}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:30:17: error: 'memset' was not declared in this scope
   30 |                 memset(field, 0, sizeof(field));
      |                 ^~~~~~
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++

std::string m[12];
void d(int x,int y){
	if(x>0&&m[y][x-1]-48)m[y][x-1]=48,d(x-1,y);
	if(x<11&&m[y][x+1]-48)m[y][x+1]=48,d(x+1,y);
	if(y>0&&m[y-1][x]-48)m[y-1][x]=48,d(x,y-1);
	if(y<11&&m[y+1][x]-48)m[y+1][x]=48,d(x,y+1);
}
main(){
	while(1){
		int y=12;
		for(;y;y--)std::cin>>m[y-1];
		if(std::cin.eof())return 0;
		int r=0;
		for(;y<12;y++)for(int x=0;x<12;x++)if(m[y][x]-48)r++,m[y][x]=48,d(x,y);
		std::cout<<r<<'\n';
	}
}

Compiler output:
a.cc:1:6: error: 'string' in namespace 'std' does not name a type
    1 | std::string m[12];
      |      ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | std::string m[12];
a.cc: In function 'void d(int, int)':
a.cc:3:17: error: 'm' was not declared in this scope
    3 |         if(x>0&&m[y][x-1]-48)m[y][x-1]=48,d(x-1,y);
      |                 ^
a.cc:4:18: error: 'm' was not declared in this scope
    4 |         if(x<11&&m[y][x+1]-48)m[y][x+1]=48,d(x+1,y);
      |                  ^
a.cc:5:17: error: 'm' was not declared in this scope
    5 |         if(y>0&&m[y-1][x]-48)m[y-1][x]=48,d(x,y-1);
      |                 ^
a.cc:6:18: error: 'm' was not declared in this scope
    6 |         if(y<11&&m[y+1][x]-48)m[y+1][x]=48,d(x,y+1);
      |                  ^
a.cc: At global scope:
a.cc:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:11:33: error: 'cin' is not a member of 'std'
   11 |                 for(;y;y--)std::cin>>m[y-1];
      |                                 ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | std::string m[12];
a.cc:11:38: error: 'm' was not declared in this scope
   11 |                 for(;y;y--)std::cin>>m[y-1];
      |                                      ^
a.cc:12:25: error: 'cin' is not a member of 'std'
   12 |                 if(std::cin.eof())return 0;
      |                         ^~~
a.cc:12:25: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:55: error: 'm' was not declared in this scope
   14 |                 for(;y<12;y++)for(int x=0;x<12;x++)if(m[y][x]-48)r++,m[y][x]=48,d(x,y);
      |                                                       ^
a.cc:15:22: error: 'cout' is not a member of 'std'
   15 |                 std::cout<<r<<'\n';
      |                      ^~~~
a.cc:15:22: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <stdio.h>

void dfs(int* data,int* label,int index) {

  int new[4][2]={{1,0},{0,1},{-1,0},{0,-1}};

  int x,y;
  int nx,ny;

  int i;

  label[index]=1;

  x=index%12;
  y=index/12;

  for(i=0;i<4;i++) {

    nx=x+new[i][0];
    ny=y+new[i][1];

    if(nx<0 || nx>11 || ny<0 || ny>11) continue;

    if(label[nx+ny*12]==0 && data[nx+ny*12]==1) dfs(data,label,nx+ny*12);

  }

}
 
int main(void) {

  int data[200];

  int count;
  int idx;
  int label[200];

  char buf[50];
  int i,j;


  while(1) {

    idx=0;

    for(i=0;i<12;i++) {

      if(fgets(buf,sizeof(buf),stdin)==NULL) break;

      for(j=0;j<12;j++) {

	data[idx]=buf[j]-'0';

	idx++;

      }

    }

    /*
    for(i=0;i<12;i++) {

      for(j=0;j<12;j++) {

	printf("%d ",data[12*i+j]);

      }

      puts("");

    }
    */

    for(i=0;i<144;i++) label[i]=0;

    count=0;

    for(i=0;i<144;i++) {

      if(data[i]==1 && label[i]==0) {

	dfs(data,label,i);
	count++;

	
      }

    }

    /*
    for(i=0;i<144;i++) {

      if(i%12==0) puts("");
      printf("%d",label[i]);

    }
    */

    fgets(buf,sizeof(buf),stdin);

    printf("%d\n",count);

  }

  return 0;

}

Compiler output:
a.cc: In function 'void dfs(int*, int*, int)':
a.cc:5:7: error: expected unqualified-id before 'new'
    5 |   int new[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
      |       ^~~
a.cc:19:13: error: expected type-specifier before '[' token
   19 |     nx=x+new[i][0];
      |             ^
a.cc:20:13: error: expected type-specifier before '[' token
   20 |     ny=y+new[i][1];
      |             ^
Language: C++

#include <cstdio>

void dfs(int x, int y);
char data[16][16];

int main(void)
{
	char c;
	
	while (1){
		
		for (int i = 0; i < 12; i++){
			cin >> data[i];
		}
		if (cin.eof()) return (0);
		
		int res = 0;
		for (int i = 0; i < 12; i++){
			for (int j = 0; j < 12; j++){
				if (data[i][j] == '1'){
					dfs(i, j);
					res++;
				}
			}
		}
		
		printf("%d\n", res);
		scanf("%c", &c);
	}
	
	return (0);
}

void dfs(int x, int y)
{
	data[x][y] = '0';
	
	if (data[x - 1][y] == '1' && 0 <= (x - 1)){
		dfs(x - 1, y);
	}
	if (data[x + 1][y] == '1'){
		dfs(x + 1, y);
	}
	if (data[x][y - 1] == '1' && 0 <= (y - 1)){
		dfs(x, y - 1);
	}
	if (data[x][y + 1] == '1'){
		dfs(x, y + 1);
	}
	
	return;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: 'cin' was not declared in this scope
   13 |                         cin >> data[i];
      |                         ^~~
a.cc:15:21: error: 'cin' was not declared in this scope
   15 |                 if (cin.eof()) return (0);
      |                     ^~~
Language: C++

#include<iostream>
#include<string>
#include<cstring>
using namespace std;
int dx[4]={1,0,-1,0}, dy[4]={0,1,0,-1}, ret=0;
bool checked[12][12], f[12][12];
void bfs(int x, int y){
	checked[x][y] = true;
	for(int i=0;i<4;i++){
    if((0<=x+dx[i]&&x+dx[i]<=11&&0<=y+dy[i]&&y+dy[i]<=11){
		if(chked[x+dx[i]][y+dy[i]] == false && f[x+dx[i]][y+dy[i]] == 1){
			bfs(x+dx[i], y+dy[i]);
    }
  }
}
int main(){
  string str;
  while(getline(cin,str)){
    memset(checked, 0, sizeof(checked));
    ret = 0;
    if(str.empty()) continue;
    for(int i=0;i<12;i++){
      for(int j=0;j<12;j++){
			f[i][j] = str[j] - '0';
      }
      getline(cin,str);
    }
    for(int i=0;i<12;i++){
      for(int j=0;j<12;j++){
			if(f[i][j] == 1 && chked[i][j] == false){
				bfs(i,j);
				ret++;
			}
		}
    }
    cout << ret << endl;
  }

Compiler output:
a.cc: In function 'void bfs(int, int)':
a.cc:10:58: error: expected ')' before '{' token
   10 |     if((0<=x+dx[i]&&x+dx[i]<=11&&0<=y+dy[i]&&y+dy[i]<=11){
      |       ~                                                  ^
      |                                                          )
a.cc:15:1: error: expected primary-expression before '}' token
   15 | }
      | ^
a.cc:16:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   16 | int main(){
      |         ^~
a.cc:16:9: note: remove parentheses to default-initialize a variable
   16 | int main(){
      |         ^~
      |         --
a.cc:16:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:16:11: error: a function-definition is not allowed here before '{' token
   16 | int main(){
      |           ^
a.cc:37:4: error: expected '}' at end of input
   37 |   }
      |    ^
a.cc:7:23: note: to match this '{'
    7 | void bfs(int x, int y){
      |                       ^
Language: C++

#include <iostream>
#include <cstdlib>
#include <algorithm>
using namespace std;
int field[12+2][12+2] ={0};


void island(int x,int y) {
  int dx[4] = {1,0,-1,0};
  int dy[4] = {0,-1,0,1};

  field[x][y] = 0;
  for(int i=0;i<4;i++) {
    if(field[x+dx[i]][y+dy[i]] == 1) {
      island(x+dx[i],y+dy[i]);
    }
  }
}

int main() {
  string str;
  int ans = 0;
  while(!cin.eof()) {
    for(int i=0;i<12;i++) {
      getline(cin,str);
      for(int j=0;j<12;j++) {
        field[i+1][j+1] = atoi(str.substr(j,1).c_str());
      }
    }

    for(int i=0;i<12;i++) {
      for(int j=0;j<12;j++) {
        if(field[i+1][j+1] == 1) {
          island(i+1,j+1);
          ans++;
        }
      }
    }
    cout << ans << endl;
    ans = 0;
    // int field[12+2][12+2] ={0};
    memset(field,0,sizeof(field));
    getline(cin,str);//erase \n
  }
  return 0;
}

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

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <stdio.h>
using namespace std;
int field[12+2][12+2] ={0};


void island(int x,int y) {
  int dx[4] = {1,0,-1,0};
  int dy[4] = {0,-1,0,1};

  field[x][y] = 0;
  for(int i=0;i<4;i++) {
    if(field[x+dx[i]][y+dy[i]] == 1) {
      island(x+dx[i],y+dy[i]);
    }
  }
}

int main() {
  string str;
  int ans = 0;
  while(!cin.eof()) {
    for(int i=0;i<12;i++) {
      getline(cin,str);
      for(int j=0;j<12;j++) {
        field[i+1][j+1] = atoi(str.substr(j,1).c_str());
      }
    }

    for(int i=0;i<12;i++) {
      for(int j=0;j<12;j++) {
        if(field[i+1][j+1] == 1) {
          island(i+1,j+1);
          ans++;
        }
      }
    }
    cout << ans << endl;
    ans = 0;
    // int field[12+2][12+2] ={0};
    memset(field,0,sizeof(field));
    getline(cin,str);//erase \n
  }
  return 0;
}

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

#include <cstdio>
#include <queue>
#include <algorithm>
using namespace std;
typedef pair<int,int> P;
queue<P>que;
#define mp make_pair
#define f first
#define s second
char field[105][105];
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
int n,m,ans=0;
bool in(int c,int d){
	if(c>=1 && c<=n){
		if(d>=1 && d<=m){
			return true;
		}
	}
	return false;
}
void dfs(int a,int b){
	que.push(mp(a,b));
	while(que.size()){
		P p=que.front(); que.pop();
		for(int i=0;i<4;i++){
				if(field[p.f+dx[i]][p.s+dy[i]]=='W' && in(p.f+dx[i],p.s+dy[i])){
					que.push(mp(p.f+dx[i],p.s+dy[i]));
					field[p.f+dx[i]][p.s+dy[i]]='.';
				}
			}
		}
	}
int main(){
	int n;
	for(int i=1;;i++){
		gets(field[i]);
		if(field[i][0]==' '){
			n=i-1;
			break;
		}
	}
	int m=strlen(field[1]);
	for(int i=1;i<=n;i++){
		for(int j=m;j>=1;j--){
			field[i][j]=field[i][j-1];
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			if(field[i][j]=='W'){
				dfs(i,j);
				ans++;
			}
		}
	}
	printf("%d\n",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   36 |                 gets(field[i]);
      |                 ^~~~
      |                 getw
a.cc:42:15: error: 'strlen' was not declared in this scope
   42 |         int m=strlen(field[1]);
      |               ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <algorithm>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include <cstdio>
#include <string>

using namespace std;

int ild[12][12];

void erase_island(int i, int j, int (&ild)[12][12])
{
	ild[i][j] = -1;
	
	if(i - 1 >= 0){
		if(ild[i - 1][j] == 1)
			erase_island(i - 1, j, ild);
	}
	if(i + 1 < 12){
		if(ild[i + 1][j] == 1)
			erase_island(i + 1, j, ild);
	}
	if(j - 1 >= 0){
		if(ild[i][j - 1] == 1)
			erase_island(i, j - 1, ild);
	}
	if(j + 1 < 12){
		if(ild[i][j + 1] == 1)
			erase_island(i, j + 1, ild);
	}
}

int main()
{
	string str;
	int cont = 0;
	int i, j, k = 0;
	
	while(1)
	{
		if(k > 19)    break;
		
		for(i = 0; i < 12; i++){
			cin >> str;
			
			if(str[0] == EOF)    break;
			
			for(j = 0; j < 12; j++){
				ild[i][j] = (str[j] == '1')? 1: 0;
			}
		}
		
		if(str[0] == EOF)    break;
		
		for(i = 0; i < 12; i++){
			for(j = 0; j < 12; j++){
				if(ild[i][j] == 1){
					cont++;
					erase_island(i, j, ild);
				}
				else if(ild[i][j] == 0)
					ild[i][j] == -1;
			}
		}
		
		cout << cont << endl;
		
		k++;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:25: error: 'cin' was not declared in this scope
   41 |                         cin >> str;
      |                         ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <string>
  +++ |+#include <iostream>
    3 | 
a.cc:63:17: error: 'cout' was not declared in this scope
   63 |                 cout << cont << endl;
      |                 ^~~~
a.cc:63:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:63:33: error: 'endl' was not declared in this scope
   63 |                 cout << cont << endl;
      |                                 ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <string>
  +++ |+#include <ostream>
    3 |
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.awt.geom.Point2D;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Comparator;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
ArrayList<Point2D> array;
while((line=br.readLine()!=null){
int n=Integer.parseInt(line);
Point2D[] points=new Point2D[n];
for(int i=0;i<n;i++){
line=br.readLine();
String[] values=line.split(",");
points[i]=new Point2D.Double(Double.parseDouble(values[0]),Double.parseDouble(values[1]));
}
Arrays.sort(points,new Comparator<Point2D>(){
public int compare(Point2D p1,Point2D p2){
return (p1.getY()>p2.getY())?1:(p1.getY()<p2.getY())?-1:(p1.getX()>p2.getX())?1:(p1.getX()<p2.getX())?-1:0;
}
});
array=new ArrayList<Point2D>();
Point2D start=points[0];
array.add(now);
double px=start.getX();
double py=start.getY();
Point2D prev=start;
while(true){
Point2D min=null;
double minx=0;
double miny=0;
double maxcos=-1;
for(Point2D p : points){
if(p==prev){
continue;
}
double nx=p.getX()-prev.getX();
double ny=p.getY()-prev.getY();
double cos=(px*nx+py*ny)/(Math.hypot(px,py)*Math.hypot(nx,ny));
if(cos>maxcos){
maxcos=cos;
minx=nx;
miny=ny;
min=p;
}
}
if(min==start){
break;
}
px=minx;
py=miny;
prev=min;
array.add(min);
}
System.out.println(points.length()-array.size());
}
}
}

Compiler output:
Main.java:14: error: ')' expected
while((line=br.readLine()!=null){
                                ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.awt.geom.Point2D;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Comparator;
 
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
ArrayList<Point2D> array;
while((line=br.readLine()!=null){
int n=Integer.parseInt(line);
Point2D[] points=new Point2D[n];
for(int i=0;i<n;i++){
line=br.readLine();
String[] values=line.split(",");
points[i]=new Point2D.Double(Double.parseDouble(values[0]),Double.parseDouble(values[1]));
}
Arrays.sort(points,new Comparator<Point2D>(){
public int compare(Point2D p1,Point2D p2){
return (p1.getY()>p2.getY())?1:(p1.getY()<p2.getY())?-1:(p1.getX()>p2.getX())?1:(p1.getX()<p2.getX())?-1:0;
}
});
array=new ArrayList<Point2D>();
Point2D start=points[0];
array.add(now);
double px=start.getX();
double py=start.getY();
Point2D prev=start;
while(true){
Point2D min=null;
double minx=0;
double miny=0;
double maxcos=-1;
for(Point2D p : points){
if(p==prev){
continue;
}
double nx=p.getX()-prev.getX();
double ny=p.getY()-prev.getY();
double cos=(px*nx+py*ny)/(Math.hypot(px,py)*Math.hypot(nx,ny));
if(cos>maxcos){
maxcos=cos;
minx=nx;
miny=ny;
min=p;
}
}
if(min==start){
break;
}
px=minx;
py=miny;
prev=min;
array.add(min);
}
System.out.println(points.length()-array.size());
}
}
}

Compiler output:
Main.java:14: error: ')' expected
while((line=br.readLine()!=null){
                                ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.awt.geom.Point2D;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Comparator;
 
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
ArrayList<Point2D> array;
while((line=br.readLine())!=null){
int n=Integer.parseInt(line);
Point2D[] points=new Point2D[n];
for(int i=0;i<n;i++){
line=br.readLine();
String[] values=line.split(",");
points[i]=new Point2D.Double(Double.parseDouble(values[0]),Double.parseDouble(values[1]));
}
Arrays.sort(points,new Comparator<Point2D>(){
public int compare(Point2D p1,Point2D p2){
return (p1.getY()>p2.getY())?1:(p1.getY()<p2.getY())?-1:(p1.getX()>p2.getX())?1:(p1.getX()<p2.getX())?-1:0;
}
});
array=new ArrayList<Point2D>();
Point2D start=points[0];
array.add(now);
double px=start.getX();
double py=start.getY();
Point2D prev=start;
while(true){
Point2D min=null;
double minx=0;
double miny=0;
double maxcos=-1;
for(Point2D p : points){
if(p==prev){
continue;
}
double nx=p.getX()-prev.getX();
double ny=p.getY()-prev.getY();
double cos=(px*nx+py*ny)/(Math.hypot(px,py)*Math.hypot(nx,ny));
if(cos>maxcos){
maxcos=cos;
minx=nx;
miny=ny;
min=p;
}
}
if(min==start){
break;
}
px=minx;
py=miny;
prev=min;
array.add(min);
}
System.out.println(points.length()-array.size());
}
}
}

Compiler output:
Main.java:29: error: cannot find symbol
array.add(now);
          ^
  symbol:   variable now
  location: class Main
Main.java:60: error: cannot find symbol
System.out.println(points.length()-array.size());
                         ^
  symbol:   method length()
  location: variable points of type Point2D[]
2 errors
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()
 
#define REP(i,s,e)	for(int i=(s); i<(e); i++)
#define rep(i,n)	REP(i,0,n)
#define REPE(i,s,e)	for(int i=s; i>e; i--)
#define repe(i,n)	REPE(i,n,-1)


typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
typedef vector<vi> vii;
 
const int IMAX=((1<<30)-1)*2+1;
const int INF=100000000;
const double EPS=1e-10;
//int mod=1000000007
 

//??????????±???????

// ??????????????????????¶????????????????
double add(double a,double b){
	if(abs(a + b) < EPS * (abs(a) + abs(b))) return 0;
	return a + b;
}

// ????¬?????????????????§???????
struct P {
	double x,y;
	P(){}
	P(double x,double y) : x(x), y(y){
	}
	P operator + (P p){
		return P(add(x, p.x), add(y, p.y));
	}
	P operator - (P p){
		return P(add(x, -p.x), add(y, -p.y));
	}
	P operator * (double d){
		return P(x * d, y * d);
	}
	double dot(P p){	// ??????
		return add(x * p.x, y * p.y);
	}
	double det(P p){	// ??????
		return add(x * p.y, -y * p.x);
	}
};

// ???????????§??????
bool cmp_x(const P& p, const P& q){
	if(p.x != q.x) return p.x <q.x;
	return p.y<q.y;
}

// ??????????±???????	
vector<P> convex_hull(P* ps, int n){
	sort(ps, ps + n, cmp_x);
	int k = 0;				//?????????????????°
	vector<P> qs(n * 2);	//?§????????????????
	// ?????´???????????????
	for(int i = 0; i < n; i++){
		while(k > 1 && (qs[k - 1] - qs[ k - 2]).det(ps[i] - qs[k - 1]) <= 0) k--;
		qs[k++] = ps[i];
	}
	// ?????´???????????????
	for(int i = n - 2, t = k; i >= 0; i--){
		while(k > t && (qs[k - 1] - qs[k - 2]).det(ps[i] - qs[k - 1]) <=0 ) k--;
		qs[k++] = ps[i];
	}
	qs.resize(k - 1);
	return qs;
}

int MAX_N =100;
P ps[MAX_N];
//vector<P> ps(MAX_N);

int main(){
	int n;

	while(cin>>n && n>0){
		rep(i,n) cin>>ps[i].x>>ps[i].y;
		cout<<n-convex_hull(ps, n).size()<<endl;
	}
	
}

Compiler output:
a.cc:100:6: error: size of array 'ps' is not an integral constant-expression
  100 | P ps[MAX_N];
      |      ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

const double PI = 3.14159;

int main()
{
	while (true) {
		int n;
		cin >> n;
		if (n==0) break;
		
		vector<double> x; x.reserve(100);
		vector<double> y; y.reserve(100);
		double tmp_x, tmp_y;
		char dummy;
		for (int i=0; i<n; i++) {
			cin >> tmp_x >> dummy >> tmp_y;
			x.push_back(tmp_x); y.push_back(tmp_y);
		}
		
		double min_y = y[0];
		int min_y_index = 0;
		for (int i=1; i<n; i++) {
			if (min_y > y[i]) { min_y = y[i]; min_y_index = i; }
		}
		
		int curr_index = min_y_index;
		int circumference_points = 0;
		double curr_deg = 0.0;
		do {
			double min_deg = PI;
			double min_deg_index;
			double tmp_deg;
			for (int i=0; i<n; i++) {
				if (i == curr_index) continue;
				tmp_deg = atan2( y[i] - y[curr_index], x[i] - x[curr_index] );
				tmp_deg -= curr_deg;cout << min_deg_index << " " <<
				tmp_deg += (tmp_deg < 0) ? 2*PI : 0;
				if ( min_deg > tmp_deg ) {
					min_deg = tmp_deg; min_deg_index = i;
				}
			}
			curr_deg += min_deg;
			curr_index = min_deg_index;
			circumference_points++;
			// cout << min_deg_index << " " << curr_deg * 180 / PI << endl;
		} while (curr_index != min_y_index);
		
		cout << n - circumference_points << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:41: error: no match for 'operator+=' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'double')
   41 |                                 tmp_deg -= curr_deg;cout << min_deg_index << " " <<
      |                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   42 |                                 tmp_deg += (tmp_deg < 0) ? 2*PI : 0;
      |                                 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

const double PI = 3.14159;

int main()
{
	while (true) {
		int n;
		cin >> n;
		if (n==0) break;
		
		vector<double> x; x.reserve(100);
		vector<double> y; y.reserve(100);
		double tmp_x, tmp_y;
		char dummy;
		for (int i=0; i<n; i++) {
			cin >> tmp_x >> dummy >> tmp_y;
			x.push_back(tmp_x); y.push_back(tmp_y);
		}
		
		double min_y = y[0];
		int min_y_index = 0;
		for (int i=1; i<n; i++) {
			if (min_y > y[i]) { min_y = y[i]; min_y_index = i; }
		}
		
		int curr_index = min_y_index;
		int circumference_points = 0;
		double curr_deg = 0.0;
		do {
			double min_deg = PI;
			double min_deg_index;
			double tmp_deg;
			for (int i=0; i<n; i++) {
				if (i == curr_index) continue;
				tmp_deg = atan2( y[i] - y[curr_index], x[i] - x[curr_index] );
				tmp_deg -= curr_deg;cout << min_deg_index << " " <<
				if (tmp_deg < 0) tmp_deg += 2*PI;
				if (min_deg > tmp_deg) {
					min_deg = tmp_deg; min_deg_index = i;
				}
			}
			curr_deg += min_deg;
			curr_index = min_deg_index;
			circumference_points++;
			// cout << min_deg_index << " " << curr_deg * 180 / PI << endl;
		} while (curr_index != min_y_index);
		
		cout << n - circumference_points << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:33: error: expected primary-expression before 'if'
   42 |                                 if (tmp_deg < 0) tmp_deg += 2*PI;
      |                                 ^~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

const double PI = 3.14159;

int main()
{
	while (true) {
		int n;
		cin >> n;
		if (n==0) break;
		
		vector<double> x; x.reserve(100);
		vector<double> y; y.reserve(100);
		double tmp_x, tmp_y;
		char dummy;
		for (int i=0; i<n; i++) {
			cin >> tmp_x >> dummy >> tmp_y;
			x.push_back(tmp_x); y.push_back(tmp_y);
		}
		
		double min_y = y[0];
		int min_y_index = 0;
		for (int i=1; i<n; i++) {
			if (min_y > y[i]) { min_y = y[i]; min_y_index = i; }
		}
		
		int curr_index = min_y_index;
		int circumference_points = 0;
		double curr_deg = 0.0;
		do {
			double min_deg = PI;
			double min_deg_index;
			double tmp_deg;
			for (int i=0; i<n; i++) {
				if (i == curr_index) continue;
				tmp_deg = atan2( y[i] - y[curr_index], x[i] - x[curr_index] );
				tmp_deg -= curr_deg;cout << min_deg_index << " " <<;
				if (tmp_deg < 0) tmp_deg += 2*PI;
				if (min_deg > tmp_deg) {
					min_deg = tmp_deg; min_deg_index = i;
				}
			}
			curr_deg += min_deg;
			curr_index = min_deg_index;
			circumference_points++;
			// cout << min_deg_index << " " << curr_deg * 180 / PI << endl;
		} while (curr_index != min_y_index);
		
		cout << n - circumference_points << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:84: error: expected primary-expression before ';' token
   41 |                                 tmp_deg -= curr_deg;cout << min_deg_index << " " <<;
      |                                                                                    ^
Language: C++

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

const double EPS = 1e-10;

class Point{
public:
  double x,y;
  Point (double x = 0,double y = 0): x(x),y(y){}
  Point operator + (Point &p){ return Point(x+p.x,y+p.y);}
  Point operator - (Point &p){ return Point(x-p.x,y-p.y);}
  Point operator * (double k){ return Point(x*k,y*k);}
  bool operator < (const Point &p)const {
    if(x == p.x) return y < p.y;
    else return x < p.x;
  }

};
typedef Point Vector;

double cross(Vector a, Vector b){ return a.x * b.y - a.y * b.x;}

int Convex_Hull(vector<Point> v){
  vector<Point> c; //convex
  sort(v.begin(),v.end());
  c.assign(v.begin(),v.begin()+2);

  for(int i=2;i<v.size();i++){
    Vector a = c[c.size()-1] - c[c.size()-2];
    Vector b = v[i] - c[c.size()-2];

    while(cross(a,b) > EPS){
      c.pop_back();
      if(c.size() < 2) break;
      a = c[c.size()-1] - c[c.size()-2];
      b = v[i] - c[c.size()-2];
    }

    c.push_back(v[i]);
  }

  int n = c.size();
  c.push_back(v[v.size()-2]);

  for(int i=v.size()-3;i>=0;i--){
    Vector a = c[c.size()-1] - c[c.size()-2];
    Vector b = v[i] - c[c.size()-2];

    while(cross(a,b) > EPS){
      c.pop_back();
      if(c.size() < n + 1) break;
      a = c[c.size()-1] - c[c.size()-2];
      b = v[i] - c[c.size()-2];
    }

    c.push_back(v[i]);
  }
  c.pop_back();

  return c.size();
}

int main(){
  int n;
  while(cin >> n && n){
    vector<Point> v(n);
    for(int i=0;i<n;i++) scanf("%lf,%lf",&v[i].x,&v[i].y);
    cout << n - Convex_Hull(v) << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int Convex_Hull(std::vector<Point>)':
a.cc:28:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   28 |   sort(v.begin(),v.end());
      |   ^~~~
      |   sqrt
Language: C++

#include<iostream>
#include<cmath>
#include<cstdio>
#include<vector>

using namespace std;

double EPS = 1e-10;

double add(double a,double b){
  if(abs(a+b)<EPS*(abs(a)+abs(b)))return 0;
  return a+b;
}

struct P{
  double x,y;
  P() {}
  P(double x,double y):x(x),y(y){
  }
  P operator + (P p){
    return P(add(x,p.x),add(y,p.y));
  }
  P operator - (P p){
    return P(add(x,-p.x),add(y,-p.y));
  }
  P operator * (double d){
    return P(x*d,y*d);
  }
  double dot(P p){
    return add(x*p.x,y*p.y);
  }
  double det(P p){
    return add(x*p.y, -y*p.x);
  }
};

bool cmp_x(const P& p, const P& q){
  if(p.x != q.x)return p.x<q.x;
  return p.y < q.y;
}

vector<P>convex_hull(P* ps, int n){
  sort(ps,ps+n,cmp_x);
  int k=0;
  vector<P>qs(n*2);

  for(int i=0;i<n;i++){
    while(k>1&&(qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])<=0)k--;
    qs[k++]=ps[i];
  }

  for(int i=n-2,t=k;i>=0;i--){
    while(k>t&&(qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])<=0)k--;
    qs[k++]=ps[i];
  }
  qs.resize(k-1);
  return qs;
}

int main(void){
  int n;
  double x,y;
  P p[100];

  while(cin >> n,n){
    for(int i=0;i<n;i++)
      scanf("%lf,%lf",&p[i].x,&p[i].y);
 
    vector<P>d=convex_hull(p,n);

    cout << n-d.size() << endl;
  }


  return 0;
}

Compiler output:
a.cc: In function 'std::vector<P> convex_hull(P*, int)':
a.cc:43:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   43 |   sort(ps,ps+n,cmp_x);
      |   ^~~~
      |   sqrt
Language: C++

#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
main(){
	int n,i,start,M;
	double x,y,dX,dY,dx,dy,dot,n1,n2,co,m;
	for(;scanf("%d",&n),n;){
		vector<pair<pair<double,double>,int> >v;
		for(i=0;i<n;i++)scanf("%lf,%lf",&x,&y),v.push_back(make_pair(make_pair(x,y),i));
		pair<pair<double,double>,int>p=*min_element(v.begin(),v.end());
		dX=0,dY=-1;
		start=p.second;
		vector<int>V;
		for(;;){
			m=-1,M=0;
			for(i=0;i<n;i++){
				if(i==p.second)continue;
				dx=v[i].first.first-p.first.first,dy=v[i].first.second-p.first.second;
				dot=dX*dx+dY*dy;
				n1=hypot(dX,dY),n2=hypot(dx,dy);
				co=dot/n1/n2;
				//printf("%f\n",co);
				if(m<co)m=co,M=i;
			}
			if(M==start)break;
			V.push_back(M);
			//printf("---%d %d\n",M,start);
			dX=v[M].first.first-p.first.first,dY=v[M].first.second-p.first.second;
			p=v[M];
		}
		printf("%d\n",n-V.size()-1);
	}
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:14: error: 'scanf' was not declared in this scope
    8 |         for(;scanf("%d",&n),n;){
      |              ^~~~~
a.cc:32:17: error: 'printf' was not declared in this scope
   32 |                 printf("%d\n",n-V.size()-1);
      |                 ^~~~~~
a.cc:4:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    3 | #include <cmath>
  +++ |+#include <cstdio>
    4 | using namespace std;
Language: C++

#include <vector>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;
main(){
	int n,i,start,M;
	double x,y,dX,dY,dx,dy,dot,n1,n2,co,m;
	for(;scanf("%d",&n),n;){
		vector<pair<pair<double,double>,int> >v;
		for(i=0;i<n;i++)scanf("%lf,%lf",&x,&y),v.push_back(make_pair(make_pair(x,y),i));
		pair<pair<double,double>,int>p=*min_element(v.begin(),v.end());
		dX=0,dY=-1;
		start=p.second;
		vector<int>V;
		for(M=-1;M!=start;){
			m=-1,n1=hypot(dX,dY)
			for(i=0;i<n;i++){
				if(i==p.second)continue;
				dx=v[i].first.first-p.first.first,dy=v[i].first.second-p.first.second;
				dot=dX*dx+dY*dy;
				n2=hypot(dx,dy),co=dot/n1/n2;
				if(m<co)m=co,M=i;
			}
			V.push_back(M);
			dX=v[M].first.first-p.first.first,dY=v[M].first.second-p.first.second;
			p=v[M];
		}
		printf("%d\n",n-V.size());
	}
}

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:17:45: error: expected ';' before 'for'
   17 |                         m=-1,n1=hypot(dX,dY)
      |                                             ^
      |                                             ;
   18 |                         for(i=0;i<n;i++){
      |                         ~~~                  
a.cc:18:40: error: expected ';' before ')' token
   18 |                         for(i=0;i<n;i++){
      |                                        ^
      |                                        ;
Language: C++

#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <cfloat>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>

using namespace std;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )
#define EACH( v, c ) for ( auto &v : c )

#define ALL( c ) (c).begin(), (c).end()

struct Point
{
	double x, y;

	Point() : x( 0 ), y( 0 )
	{
		return;
	}

	Point( double x, double y ) : x( x ), y( y )
	{
		return;
	}

	Point operator + ( const Point &a ) const
	{
		return Point( x + a.x, y + a.y );
	}

	Point operator - ( const Point &a ) const
	{
		return Point( x - a.x, y - a.y );
	}

	Point operator * ( const double &a ) const
	{
		return Point( x * a, y * a );
	}

	Point operator / ( const double &a ) const
	{
		return Point( x / a, y / a );
	}

	bool operator < ( const Point &a ) const
	{
		return x == a.x ? y < a.y : x < a.x;
	}
};

// 外積
double cross( const Point &a, const Point &b )
{
	return a.x * b.y - a.y * b.x;
}

// グラハムスキャン
vector< Point > getConvex( vector< Point > ps )
{
	const int N = ps.size();

	sort( ALL( ps ) );

	int k = 0;
	vector< Point > convex( N * 2 );

	for ( int i = 0; i < N; i++ )
	{
		while ( 2 <= k && cross( convex[ k - 1 ] - convex[ k - 2 ], ps[i] - convex[ k - 1 ] ) <= EPS )
		{
			k--;
		}

		convex[ k++ ] = ps[i];
	}

	for ( int i = N - 2, t = k; 0 <= i; i-- )
	{
		while ( t < k && cross( convex[ k - 1 ] - convex[ k - 2 ], ps[i] - convex[ k - 1 ] ) <= EPS )
		{
			k--;
		}

		convex[ k++ ] = ps[i];
	}

	convex.resize( k - 1 );

	return convex;
}

int main()
{
	cin.tie( 0 );
	ios::sync_with_stdio( false );

	while ( true )
	{
		int n;
		cin >> n;

		if ( !n )
		{
			break;
		}

		vector< Point > ps( n );

		EACH( p, ps )
		{
			char d;

			cin >> p.x >> d >> p.y;
		}

		vector< Point > convex = getConvex( ps );

		cout << n - convex.size() << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'std::vector<Point> getConvex(std::vector<Point>)':
a.cc:87:106: error: 'EPS' was not declared in this scope
   87 |                 while ( 2 <= k && cross( convex[ k - 1 ] - convex[ k - 2 ], ps[i] - convex[ k - 1 ] ) <= EPS )
      |                                                                                                          ^~~
a.cc:97:105: error: 'EPS' was not declared in this scope
   97 |                 while ( t < k && cross( convex[ k - 1 ] - convex[ k - 2 ], ps[i] - convex[ k - 1 ] ) <= EPS )
      |                                                                                                         ^~~