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

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


int main(void){
	int n;
	bool o = 0 ;
	while(cin>>n,n){
		if(cnt ++ > 0)cout<<endl;
		string name[n];
		int sum[n],point;
		int rank[n];
		for(int i = 0 ; i < n ; i ++){
			cin>>name[i];
			cin>>point; //win
			sum[i]=point*3;
			cin>>point;	//lose;
			cin>>point; //drow
			sum[i]+=point;
			rank[i]=i;			
		}
		for(int i = 0 ; i < n ; i ++)
			for(int j = 0 ; j < n ; j ++){
				if(sum[rank[i]]>sum[rank[j]]){
					int t = rank[i];
					rank[i] = rank[j];
					rank[j] = t;
				}
			}
		if(o)cout<<endl;
		o = true;
		for(int i = 0 ; i < n ; i ++)
			cout<<name[rank[i]]<<","<<sum[rank[i]]<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: 'cnt' was not declared in this scope; did you mean 'int'?
   11 |                 if(cnt ++ > 0)cout<<endl;
      |                    ^~~
      |                    int
Language: C++

#include <algorithm>
#include <vector>
#include <functional>
#include <utility>
#include <string>

using namespace std;

int main()
{
	vector<pair<int, pair<int, string> > > team;
	int n, pt[10][3];
	string str[10];

	while(1){
		cin >> n;

		if(n == 0)    break;

		for(int i = 0; i < n; i++)
			cin >> str[i] >> pt[i][0] >> pt[i][1] >> pt[i][2];

		for(int i = 0; i < n; i++)
			team.push_back(make_pair(((pt[i][0] * -3) - pt[i][2]), make_pair(i, str[i])));

		stable_sort(team.begin(), team.end());

		cout << endl;

		for(int i = 0; i < n; i++)
			cout << team[i].second.second << "," << -(team[i].first) << endl;
		
		team.clear();
	}

	return 0;
}

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

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

struct Country{string name; int wp;};
vector<Country> Allteam;

bool comp(const Country& c1, const Country& c2){
  return (c1.wp > c2.wp);
}

int main(void){
  int n;
  while(cin >> n, n){
    for(int i = 0; i < n; i++){
      string tname;
      int w, l, d;
      cin >> tname >> w >> l >> d;
      Country c = {tname, w * 3 + d};
      Allteam.push_back(c);
    }
    sort(Allteam.begin(), Allteam.end(), comp);
    for(int i = 0; i < Allteam.size(); i++){
      cout << Allteam[i].name << "," << Allteam[i].wp << endl;
    }
    cout << endl;
    Allteam.clear();
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   23 |     sort(Allteam.begin(), Allteam.end(), comp);
      |     ^~~~
      |     short
Language: C++

#include<stdio.h> 
#include<string> 
#include<iostream> 
using namespace std;   
struct TA{ 
	string name; int po; int rr;
};     
int main(){ 
	int n; 
	struct TA N[11];  
	bool ty=true;
	while(1){ scanf("%d",&n);
	if(n==0)break; for(int i=0;i<n;i++) 
	if(ty==false)cout<<endl;
	ty=false;
	
	{cin>>N[i].name;int a,b,c; cin>>a>>b>>c; 
	N[i].po=a*3+c*1; N[i].rr=i; } 
	for(int i=0;i<n;i++) for(int j=n-1;j>i;j--) 
		if(N[j].po>N[j-1].po){struct TA T=N[j];N[j]=N[j-1];N[j-1]=T;}   
		for(int i=0;i<n;i++) 
		cout<<N[i].name<<","<<N[i].po<<endl;         
	}
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'i' was not declared in this scope
   17 |         {cin>>N[i].name;int a,b,c; cin>>a>>b>>c;
      |                 ^
Language: C++

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

int main()
{
	char coun[11][21];
	int score[11],win,lose,draw,max[11];
	int i,j,n;
	
	for(;;){
		max=0;
		scanf("%d",&n);
		if(n==0)break;
		for(i=0;i<n;i++){
			scanf("%s",coun[i]);
			scanf("%d%d%d", &win, &lose, &draw);
			score[i]=win*3+draw;
			max[i]=score;
		}
		for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				if(max[i]>max[j]){
					max[10]=max[i];
					max[i]=max[j];
					max[j]=max[10];
				}
			}
		}
		for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				if(max[i]==score[j]){
					printf("%s,%d",coun[j],score[i]);
					score[i]=-1;
				}
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: incompatible types in assignment of 'int' to 'int [11]'
   11 |                 max=0;
      |                 ~~~^~
a.cc:18:32: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   18 |                         max[i]=score;
      |                                ^~~~~
      |                                |
      |                                int*
Language: C++

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

int main()
{
	char coun[11][21];
	int score[11],win,lose,draw,max[11];
	int i,j,n;
	
	for(;;){
		scanf("%d",&n);
		if(n==0)break;
		for(i=0;i<n;i++){
			scanf("%s",coun[i]);
			scanf("%d%d%d", &win, &lose, &draw);
			score[i]=win*3+draw;
			max[i]=score;
		}
		for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				if(max[i]>max[j]){
					max[10]=max[i];
					max[i]=max[j];
					max[j]=max[10];
				}
			}
		}
		for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				if(max[i]==score[j]){
					printf("%s,%d",coun[j],score[i]);
					score[i]=-1;
				}
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:32: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   17 |                         max[i]=score;
      |                                ^~~~~
      |                                |
      |                                int*
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
#include <functional>

using namespace std;

bool cmp(pair<int,string> a , pair<int,string> b){  
	return a.first > b.first; 
} 

int main(void){
	while(1){
		int a,n;
		string s;
		vector< pair<int,string> > P;
		int w,d,l;
		if(c++)cout << endl;
		cin >> n;
		if(n==0)break;
		for(a=0;a<n;a++){
			 cin >> s >> w >> l >> d; 
			P.push_back(make_pair(w*3+d,s));
		}
		stable_sort(P.begin(),P.end(),cmp);
		for(a=0;a<n;a++){
			cout << P[a].second << "," << P[a].first << endl; 
		}
	}
	return 0;
}

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

using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

const int MAXP = 31;

int main()
{
    string s;
    int n, w, l, e;
    bool sec = false;
    while(cin >> n && n)
    {
        if(sec) cout << endl;
        vector<string> teams[MAXP];
        
        REP(n)
        {
            cin >> s >> w >> l >> e;
            teams[w * 3 + e].push_back(s);
        }
        
        for(int i = MAXP-1;i!= 0; i--)rep(j,teams[i].size())
            cout << teams[i][j] << "," << i << endl;
        
        sec = true;

    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'string' was not declared in this scope
   11 |     string s;
      |     ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:14:11: error: 'cin' was not declared in this scope
   14 |     while(cin >> n && n)
      |           ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:16:17: error: 'cout' was not declared in this scope
   16 |         if(sec) cout << endl;
      |                 ^~~~
a.cc:16:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:25: error: 'endl' was not declared in this scope
   16 |         if(sec) cout << endl;
      |                         ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc:17:9: error: 'vector' was not declared in this scope
   17 |         vector<string> teams[MAXP];
      |         ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:17:24: error: 'teams' was not declared in this scope
   17 |         vector<string> teams[MAXP];
      |                        ^~~~~
a.cc:21:20: error: 's' was not declared in this scope
   21 |             cin >> s >> w >> l >> e;
      |                    ^
a.cc:26:13: error: 'cout' was not declared in this scope
   26 |             cout << teams[i][j] << "," << i << endl;
      |             ^~~~
a.cc:26:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:48: error: 'endl' was not declared in this scope
   26 |             cout << teams[i][j] << "," << i << endl;
      |                                                ^~~~
a.cc:26:48: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
#include <utility>
#include <string>

using namespace std;

int main()
{
	vector<pair<int, pair<int, string> > > team;
	int n, pt[10][3];
	string str[10];

	while(1){
		cin >> n;

		if(n == 0)    break;

		for(int i = 0; i < n; i++)
			cin >> str[i] >> pt[i][0] >> pt[i][1] >> pt[i][2];

		for(int i = 0; i < n; i++)
			team.push_back(make_pair(((pt[i][0] * -3) - pt[i][2]), make_pair(i, str[i])));
		
		cout << endl;
		
		sort(team.begin(), team.end());
		
		for(int i = 0; i < n; i++)
			cout << team[i].second.second << "," << -(team[i].first) << endl;
		
		cout << endl
		
		team.clear();
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:29: error: expected ';' before 'team'
   34 |                 cout << endl
      |                             ^
      |                             ;
   35 | 
   36 |                 team.clear();
      |                 ~~~~
Language: Java

import java.util.Scanner;

public class Tes {
	static final int[] md = new int[12];
	static {
		int[] days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
		int day = 0;
		for (int i = 1; i < 12; i++) {
			md[i] = day;
			day += days[i];
		}
	}

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while (true) {
			int y1 = in.nextInt();
			int m1 = in.nextInt();
			int d1 = in.nextInt();
			int y2 = in.nextInt();
			int m2 = in.nextInt();
			int d2 = in.nextInt();
			if (y1 < 0 || y2 < 0 || m1 < 0 || m2 < 0 || d1 < 0 || d2 < 0) {
				break;
			}
			long from = getL(y1, m1, d1);
			long to = getL(y2, m2, d2);
			System.out.println(to - from);
		}
	}

	private static long getL(int y, int m, int d) {
		long result = 365 * y + md[m - 1] + d;
		if (m > 2 && (y % 400 == 0 || (y % 100 != 0 && y % 4 == 0))) {
			result++;
		}
		result += (y - 1) / 4;
		result -= (y - 1) / 100;
		result += (y - 1) / 400;
		return result;
	}
}

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

#include<stdio.h>
int main(void)
{
	int a[11]={31,28,31,30,31,30,31,31,30,31,30};
	int y1,m1,d1,y1,y2,m2,d2;
	int i,j,n,u,w;
	while(1){
		scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);
		if(y1<0||y2<0||m1<0||m2<0||d1<0||d2<0)
		break;
		n=0;
		for(j=y1;j<=y2;j++){
			u=0;
			if(j%4==0){
				u=1;
				if(j%400==0){
					u=1;
				}
				else if(j%100==0){
					u=0;
				}
			}
			if(u==1){
				d2=d2+1;
			}
		}
		n-0;
		for(i=0;i<m1;i++){
			n=n+a[i];
		}
		w=0;
		for(i=0;i<m2;i++){
			w=w+a[i];
		}
		u=0;
		if(y1%4==0){
			u=1;
			if(y1%400==0){
				u=1;
			}
			else if(y1%100){
				u=0;
			}
			if(u==1&&m1>3){
				d2=d2-1;
			}
		}
		u=0;
		if(y2%4==0){
			u=1;
			if(y2%400==0){
				u=1;
			}
			else if(y2%100){
				u=0;
			}
			if(u==1&&m2<3){
				d2=d2-1;
			}
		}
		printf("%d\n",(y2-y1)*365+(w-n)+d2-d1);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:22: error: redeclaration of 'y1' with no linkage
    5 |         int y1,m1,d1,y1,y2,m2,d2;
      |                      ^~
main.c:5:13: note: previous declaration of 'y1' with type 'int'
    5 |         int y1,m1,d1,y1,y2,m2,d2;
      |             ^~
Language: C

#include<stdio.h>
#include<string.h>
 int main(void)
 {
 	int y1,y2,m1,m2,d1,d2,y=0,i,all=0,b=0,c=0,u;
 	int a[12]={0};
 	while(1){
 	scanf("%d %d %d %d %d %d",&y1,&m1,&d1,&y2,&m2,&d2);
 	if(y2-y1!=0){
 	for(i=y1;i<y2;i++){
 		u=0;
 		if((i%4)==0){
 			u=1;
 		if((i%100)==0){
 			u=0;
 		if((i%400)==0){
 			u=1;
 		}
 		}
 		}
 		if(u==0){
 			y+=365;
 		}
 		else{
 			y+=366;
 		}
 	}
 	}
 		a[1]=31;
 		if(u==0){
 		a[2]=28;
 		}
 		else{
 			a[2]=29;
 		}
 		a[3]=31;
 		a[4]=30;
 		a[5]=31;
 		a[6]=30;
 		a[7]=31;
 		a[8]=31;
 		a[9]=30;
 		a[10]=31;
 		a[11]=30;
 		a[12]=31;
 		for(i=1;i<=m1;i++){
 			b+=a[i];
 		}
 		for(i=1;i<=m2;i++){
 			c+=a[i];
 		}
 		b+=d1;
 		c+=d2;
 		all=y+(c-b);
 		printf("%d\n",all);
 		if(y1==-1 && y2==-1 && m1==-1 && m2=-1 && d1==-1 && d2==-1){
 			break;
 		}
 }
 }
 
 	

Compiler output:
main.c: In function 'main':
main.c:56:52: error: lvalue required as left operand of assignment
   56 |                 if(y1==-1 && y2==-1 && m1==-1 && m2=-1 && d1==-1 && d2==-1){
      |                                                    ^
Language: C

#include<stdio.h>
#include<string.h>
 int main(void)
 {
 	int y1,y2,m1,m2,d1,d2,y=0,i,all=0,b=0,c=0,u;
 	int a[12]={0};
 	while(1){
 	scanf("%d %d %d %d %d %d",&y1,&m1,&d1,&y2,&m2,&d2);
 	if(y2-y1!=0){
 	for(i=y1;i<y2;i++){
 		u=0;
 		if((i%4)==0){
 			u=1;
 		if((i%100)==0){
 			u=0;
 		if((i%400)==0){
 			u=1;
 		}
 		}
 		}
 		if(u==0){
 			y+=365;
 		}
 		else{
 			y+=366;
 		}
 	}
 	}
 		a[1]=31;
 		if(u==0){
 		a[2]=28;
 		}
 		else{
 			a[2]=29;
 		}
 		a[3]=31;
 		a[4]=30;
 		a[5]=31;
 		a[6]=30;
 		a[7]=31;
 		a[8]=31;
 		a[9]=30;
 		a[10]=31;
 		a[11]=30;
 		a[12]=31;
 		for(i=1;i<=m1;i++){
 			b+=a[i];
 		}
 		for(i=1;i<=m2;i++){
 			c+=a[i];
 		}
 		b+=d1;
 		c+=d2;
 		all=y+(c-b);
 		 		if(y1==-1 && y2==-1 && m1==-1 && m2=-1 && d1==-1 && d2==-1){
 			break;
 		}
 		printf("%d\n",all);

 }
 }
 
 	

Compiler output:
main.c: In function 'main':
main.c:55:68: error: lvalue required as left operand of assignment
   55 |                                 if(y1==-1 && y2==-1 && m1==-1 && m2=-1 && d1==-1 && d2==-1){
      |                                                                    ^
Language: C

#include<stdio.h>
int main(void)
{
	int a[11]={31,28,31,30,31,30,31,31,30,31,30};
	int y1,m1,d1,y1,y2,m2,d2;
	int i,j,n,u,w;
	while(1){
		scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);//
		if(y1<0||y2<0||m1<0||m2<0||d1<0||d2<0)
		break;
		n=0;
		for(j=y1;j<=y2;j++){
			u=0;
			if(j%4==0){
				u=1;
				if(j%400==0){
					u=1;
				}
				else if(j%100==0){
					u=0;
				}
			}
			if(u==1){
				d2=d2+1;
			}
		}
		n-0;
		for(i=0;i<m1;i++){
			n=n+a[i];
		}
		w=0;
		for(i=0;i<m2;i++){
			w=w+a[i];
		}
		u=0;
		if(y1%4==0){
			u=1;
			if(y1%400==0){
				u=1;
			}
			else if(y1%100){
				u=0;
			}
			if(u==1&&m1>60){
				d2=d2-1;
			}
		}
		u=0;
		if(y2%4==0){
			u=1;
			if(y2%400==0){
				u=1;
			}
			else if(y2%100){
				u=0;
			}
			if(u==1&&w<60){
				d2=d2-1;
			}
		}
		printf("%d\n",(y2-y1)*365+(w-n)+d2-d1);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:22: error: redeclaration of 'y1' with no linkage
    5 |         int y1,m1,d1,y1,y2,m2,d2;
      |                      ^~
main.c:5:13: note: previous declaration of 'y1' with type 'int'
    5 |         int y1,m1,d1,y1,y2,m2,d2;
      |             ^~
Language: C

#include<stdio.h>
int main(void)
{
	int a[11]={31,28,31,30,31,30,31,31,30,31,30};
	int y1,m1,d1,y1,y2,m2,d2;
	int i,j,n,u,w;
	while(1){
		scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);//??\???
		if(y1<0||y2<0||m1<0||m2<0||d1<0||d2<0)
		break;
		n=0;
		for(j=y1;j<=y2;j++){ 
			u=0;
			if(j%4==0){
				u=1;
				if(j%400==0){
					u=1;
				}
				else if(j%100==0){
					u=0;
				}
			}
			if(u==1){
				d2=d2+1;
			}
		}
		n-0;
		for(i=0;i<m1;i++){
			n=n+a[i];
		}
		w=0;
		for(i=0;i<m2;i++){
			w=w+a[i];
		}
		u=0;
		if(y1%4==0){
			u=1;
			if(y1%400==0){
				u=1;
			}
			else if(y1%100){
				u=0;
			}
			if(u==1&&m1>60){
				d2=d2-1;
			}
		}
		u=0;
		if(y2%4==0){
			u=1;
			if(y2%400==0){
				u=1;
			}
			else if(y2%100){
				u=0;
			}
			if(u==1&&w<60){
				d2=d2-1;
			}
		}
		printf("%d\n",(y2-y1)*365+(w-n)+d2-d1);//??????
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:22: error: redeclaration of 'y1' with no linkage
    5 |         int y1,m1,d1,y1,y2,m2,d2;
      |                      ^~
main.c:5:13: note: previous declaration of 'y1' with type 'int'
    5 |         int y1,m1,d1,y1,y2,m2,d2;
      |             ^~
Language: C

#define _CRT_SECURE_NO_WARNINGS
////#define _USE_MATH_DEFINES
#include<stdio.h>
#include<stdlib.h>
////#include<math.h>
//#include<string.h>
#include<time.h>
#define P(type,x) fprintf(stdout,"%"#type"\n",x)
void countDays();
int main() {
	countDays();
	return 0;
}

void countDays() {
	int y, m, d, days, yy, mm, dd;
	time_t s, e;
	struct tm tms, tme;
	while (fscanf(stdin, "%d%d%d%d%d%d", &y, &m, &d, &yy, &mm, &dd)) {
		if (y < 0 || m < 0 || d < 0 || yy < 0 || mm < 0 || dd < 0) break;
		tms = { 0,0,0,d,m - 1,y - 1900 };
		tme = { 0,0,0,dd,mm - 1,yy - 1900 };
		days = 0;
		s = mktime(&tms) + 86400;
		e = mktime(&tme) + 86400;
		while (e != s) s += 86400, days++;
		printf("%d\n", days);
	}
}

Compiler output:
main.c: In function 'countDays':
main.c:21:23: error: expected expression before '{' token
   21 |                 tms = { 0,0,0,d,m - 1,y - 1900 };
      |                       ^
main.c:22:23: error: expected expression before '{' token
   22 |                 tme = { 0,0,0,dd,mm - 1,yy - 1900 };
      |                       ^
Language: C

#define _CRT_SECURE_NO_WARNINGS
//#define _USE_MATH_DEFINES
#include<stdio.h>
#include<stdlib.h>
//#include<math.h>
//#include<string.h>
//#include<time.h>
#define P(type,x) fprintf(stdout,"%"#type"\n",x)
int mon[12]{ 0,31,59,90,120,151,181,212,243,273,304,334 },yea[7000];
void countDays();
int serial(int, int, int);
int isleap(int);
int main() {
	int i;
	for (i = 1; i < 7000; i++)yea[i] = yea[i - 1] + 365 + isleap(i - 1);
	countDays();
	return 0;
}

void countDays() {
	int y, m, d, days, yy, mm, dd;
	while (fscanf(stdin, "%d%d%d%d%d%d", &y, &m, &d, &yy, &mm, &dd)) {
		if (y < 0 || m < 0 || d < 0 || yy < 0 || mm < 0 || dd < 0) break;
		days = serial(yy, mm, dd) - serial(y, m, d);
		P(d, days);
	}
}

int serial(int y, int m, int d){
	return yea[y] + mon[m - 1] + d + (m > 2 && isleap(y) ? 1 : 0);
}

int isleap(int y){
	int isleap;
	isleap = y % 4 == 0;
	isleap = isleap && y % 100 != 0;
	isleap = isleap || y % 400 == 0;
	return isleap;
}

Compiler output:
main.c:9:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    9 | int mon[12]{ 0,31,59,90,120,151,181,212,243,273,304,334 },yea[7000];
      |            ^
main.c:9:58: error: expected identifier or '(' before ',' token
    9 | int mon[12]{ 0,31,59,90,120,151,181,212,243,273,304,334 },yea[7000];
      |                                                          ^
main.c: In function 'main':
main.c:15:35: error: 'yea' undeclared (first use in this function)
   15 |         for (i = 1; i < 7000; i++)yea[i] = yea[i - 1] + 365 + isleap(i - 1);
      |                                   ^~~
main.c:15:35: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'serial':
main.c:30:16: error: 'yea' undeclared (first use in this function)
   30 |         return yea[y] + mon[m - 1] + d + (m > 2 && isleap(y) ? 1 : 0);
      |                ^~~
main.c:30:25: error: 'mon' undeclared (first use in this function)
   30 |         return yea[y] + mon[m - 1] + d + (m > 2 && isleap(y) ? 1 : 0);
      |                         ^~~
Language: C

#define _CRT_SECURE_NO_WARNINGS
////#define _USE_MATH_DEFINES
#include<stdio.h>
//#include<stdlib.h>
//#include<math.h>
//#include<string.h>
#include<time.h>
#define P(type,x) fprintf(stdout,"%"#type"\n",x)
void countDays();
int main() {
	countDays();
	return 0;
}

void countDays() {
	int y, m, d, days, yy, mm, dd;
	time_t s, e;
	struct tm tms, tme;
	while (fscanf(stdin, "%d%d%d%d%d%d", &y, &m, &d, &yy, &mm, &dd)) {
		if (y < 0 || m < 0 || d < 0 || yy < 0 || mm < 0 || dd < 0) break;
		tms = { 0,0,0,d,m - 1,y - 1900,0,0,0};
		tme = { 0,0,0,dd,mm - 1,yy - 1900,0,0,0};
		days = 0;
		s = mktime(&tms) + 86400;
		e = mktime(&tme) + 86400;
		while (e != s) s += 86400, days++;
		printf("%d\n", days);
	}
}

Compiler output:
main.c: In function 'countDays':
main.c:21:23: error: expected expression before '{' token
   21 |                 tms = { 0,0,0,d,m - 1,y - 1900,0,0,0};
      |                       ^
main.c:22:23: error: expected expression before '{' token
   22 |                 tme = { 0,0,0,dd,mm - 1,yy - 1900,0,0,0};
      |                       ^
Language: C

#include <stdio.h>

int mdays(int y, int m);
int uruu(int year);

int main(void)
{
	int y1,m1,d1,y2,m2,d2;
	int i,j,days;

	while(scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2)){
		if(y1<0 || m1<0 || d1<0 || y2<0 || m2<0 || d2<0)
			break;
		for(i=y1,days=0; i<=y2; i++)
			for(i!=y1? j=1: j=m1 ; i!=y2? j<=12: j<=m2 ; j++)	
				days+=mdays(i,j);
		days-=d1;
		days-=(mdays(y2,m2)-d2);
		printf("%d\n",days);
	}

	return 0;
}

int mdays(int y,int m) 
{
	int days[12]={31,28,31,30,31,30,31,31,30,31,30,31};
	
	if(uruu(y))
		days[1]=29;

	return days[m-1];
}

int uruu(int year)
{
	if(year%400==0)
		return 1;
	else if(year%100==0)
		return 0;
	else if(year%4==0)
		return 1;

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:42: error: lvalue required as left operand of assignment
   15 |                         for(i!=y1? j=1: j=m1 ; i!=y2? j<=12: j<=m2 ; j++)
      |                                          ^
Language: C

#include <stdio.h>
#define leap(x, y, z) ((x)% 400 == 0 || ((x) % 100 && (x) % 4 == 0) ? (y) : (z))

int x[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},a,b,c,d,e,f,i,dc;

int main(){
   for(;scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f), a != -1;){
    dc = -c;
    i = a % 4;
    x[2] = leap(a, 29, 28);
    for(i = b; i <=(a==d?-1e:12); i++) dc += x[i];
    for(i = a + 1;i < d;i++) dc += leap(i, 366, 365);
    x[2] = leap(d, 29, 28);
    for(i = (a==b?13:1);i < e;i++) dc += x[i];
    printf("%d\n", dc + f);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:27: error: exponent has no digits
   11 |     for(i = b; i <=(a==d?-1e:12); i++) dc += x[i];
      |                           ^~
Language: C

#include <stdio.h>
#define leap(x, y, z) ((x)% 400 == 0 || ((x) % 100 && (x) % 4 == 0) ? (y) : (z))

int d[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},a,b,c,d,e,f,i,r;

int main(){
   for(;scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f), a != -1;){
    r = -c;
    i = a % 4;
    d[2] = leap(a, 29, 28);
    for(i = b; i <=(a==d?e-1:12); i++)
      r += d[i];
    for(i = a + 1;i < d;i++)
      r += leap(i, 366, 365);
    d[2] = leap(d, 29, 28);
    for(i = (a==d?13:1);i < e;i++)
      r += d[i];
    printf("%d\n", r + f);
  }
  return 0;
}

Compiler output:
main.c:4:71: error: conflicting types for 'd'; have 'int'
    4 | int d[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},a,b,c,d,e,f,i,r;
      |                                                                       ^
main.c:4:5: note: previous definition of 'd' with type 'int[13]'
    4 | int d[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},a,b,c,d,e,f,i,r;
      |     ^
Language: C++

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

int main()
{
	while (1)
	{
		int L, R; L = R = 0;
		int a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		if (a<0||b<0 || a<0||a<0||a<0||a<)break;
		for (int g = 1; g < a; g++)
		{
			if (g % 400 == 0) L += 366;
			else if (g % 100 == 0) L += 365;
			else if (g % 4 == 0)L += 366;
			else L += 365;
		}
		
		for (int g = 1; g < d; g++)
		{
			if (g % 400 == 0) R += 366;
			else if (g % 100 == 0) R += 365;
			else if (g % 4 == 0)R += 366;
			else R += 365;
		}
		
		for (int h = 1; h < b; h++) {
			switch (h) {
			case 1:case 3:case 5:case 7:case 8:case 10:case 12:L += 31; break;
			case 4:case 6:case 9:case 11:L += 30; break;
			case 2:if (a % 400 == 0) L += 29;
				   else if (a % 100 == 0) L += 28;
				   else if (a % 4 == 0)L += 29;
				   else L += 28;
			}
			}
			
			for (int h = 1; h < e; h++) {
				switch (h) {
				case 1:case 3:case 5:case 7:case 8:case 10:case 12:R += 31; break;
				case 4:case 6:case 9:case 11:R += 30; break;
				case 2:if (a % 400 == 0)R += 29;
					   else if (a % 100 == 0) R += 28;
					   else if (a % 4 == 0)R += 29;
					   else R += 28;
				}
			}
			
		cout << (R + f) - (L + c) << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:50: error: expected primary-expression before ')' token
   13 |                 if (a<0||b<0 || a<0||a<0||a<0||a<)break;
      |                                                  ^
Language: C++

#include<stdio.h>
int main(void){
   int y1, m1, d1, y2, m2, d2, Y1, Y2;
   while {
       scanf("%d %d %d %d %d %d", &y1, &m1, &d1, &y2, &m2, &d2);
       /*???????????´????±????????????????*/
       if ( m1 >= 3) Y1 = y1 + 1;
       else Y1 = y1;
       if ( m2 >= 3 ) Y2 = y2;
       else Y2 = y2 - 1;
       /*???????????´?????°????±???????*/
       for ( i = Y1; i < Y2; i++ ) {
           if ( i % 4 == 0 ) {
               if ( i % 400 == 0 ) u++;
               else if ( i % 100 == 0 ) u++;
               else u++;
           }
       }

    }
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:10: error: expected '(' before '{' token
    4 |    while {
      |          ^
      |          (
a.cc:4:10: error: expected primary-expression before '{' token
a.cc:4:9: error: expected ')' before '{' token
    4 |    while {
      |         ^~
      |         )
a.cc:12:14: error: 'i' was not declared in this scope
   12 |        for ( i = Y1; i < Y2; i++ ) {
      |              ^
a.cc:14:36: error: 'u' was not declared in this scope
   14 |                if ( i % 400 == 0 ) u++;
      |                                    ^
a.cc:15:41: error: 'u' was not declared in this scope
   15 |                else if ( i % 100 == 0 ) u++;
      |                                         ^
a.cc:16:21: error: 'u' was not declared in this scope
   16 |                else u++;
      |                     ^
Language: C++

#include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
int main(void){
	while( true ){
		int y1, m1, d1;
		int y2, m2, d2;
		struct tm t1, t2;
		double diff;
		time_t second1, second2;

		cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
		if( y1 == -1 && y2 == -1 && m1 == -1 && m2 == -1 && d1 == -1 && d2 == -1 )
			break;

		memset(&t1,0,sizeof(t1));
		memset(&t2,0,sizeof(t2));
		t1.tm_year = y1 - 1900;
		t1.tm_mon = m1 - 1;
		t1.tm_mday = d1;
		t2.tm_year = y2 - 1900;
		t2.tm_mon = m2 - 1;
		t2.tm_mday = d2;

		second1 = mktime( &t1 );
		second2 = mktime( &t2 );

		diff = difftime( second2, second1 );
		
		cout << (int)(diff / (3600*24)) << '\n';
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'memset' was not declared in this scope
   17 |                 memset(&t1,0,sizeof(t1));
      |                 ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<ctime>
  +++ |+#include <cstring>
    4 | using namespace std;
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)

int month[]={
  0,
  31,//1
  28,//2
  31,//3
  30,//4
  31,//5
  30,//6
  31,//7
  31,//8
  30,//9
  31,//10
  30,//11
  31//12
};

int day(int y,int m,int d){
  int base = d;
  REP(i,1,m)base+=month[i];
  int lim = m > 2 ? y+1:y;
  
  REP(i,1,y){
    base+=365
    if ( i %400 == 0 ||
	 (i % 100 !=0 && i % 4 == 0))base++;
  }
  return base;
}



/*
  correct version
int day(int y,int m,int d){
  y += 4800;
  if (m < 3) --y, m += 12;
  return 365L*y+y/4-y/100+y/400+(153*m-457)/5+d-32045;
}
*/

main(){
  int y1,m1,d1,y2,m2,d2;
  while(cin>>y1>>m1>>d1>>y2>>m2>>d2 ){
    if ( y1 < 0 || m1 < 0 || d1 < 0 || 
	 y2 < 0 || m2 < 0 || d2 < 0)break;
    int a=day(y1,m1,d1),b=day(y2,m2,d2);
    cout << b-a << endl;
  }
}

Compiler output:
a.cc: In function 'int day(int, int, int)':
a.cc:28:14: error: expected ';' before 'if'
   28 |     base+=365
      |              ^
      |              ;
   29 |     if ( i %400 == 0 ||
      |     ~~        
a.cc: At global scope:
a.cc:46:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   46 | main(){
      | ^~~~
Language: C++

#include <iostream>
using namespace std;int main(){int a,b,c,d,e,f,g;int h[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(y==-1)break;g=f-c+h[mm]-h[m]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:141: error: 'y' was not declared in this scope
    2 | using namespace std;int main(){int a,b,c,d,e,f,g;int h[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(y==-1)break;g=f-c+h[mm]-h[m]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}return 0;}
      |                                                                                                                                             ^
a.cc:2:161: error: 'mm' was not declared in this scope; did you mean 'tm'?
    2 | using namespace std;int main(){int a,b,c,d,e,f,g;int h[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(y==-1)break;g=f-c+h[mm]-h[m]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}return 0;}
      |                                                                                                                                                                 ^~
      |                                                                                                                                                                 tm
a.cc:2:167: error: 'm' was not declared in this scope
    2 | using namespace std;int main(){int a,b,c,d,e,f,g;int h[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(y==-1)break;g=f-c+h[mm]-h[m]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}return 0;}
      |                                                                                                                                                                       ^
Language: C++

#include <iostream>
using namespace std;int main(){int a,b,c,d,e,f,g,h[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(y==-1)break;g=f-c+h[mm]-h[m]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:137: error: 'y' was not declared in this scope
    2 | using namespace std;int main(){int a,b,c,d,e,f,g,h[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(y==-1)break;g=f-c+h[mm]-h[m]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}return 0;}
      |                                                                                                                                         ^
a.cc:2:157: error: 'mm' was not declared in this scope; did you mean 'tm'?
    2 | using namespace std;int main(){int a,b,c,d,e,f,g,h[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(y==-1)break;g=f-c+h[mm]-h[m]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}return 0;}
      |                                                                                                                                                             ^~
      |                                                                                                                                                             tm
a.cc:2:163: error: 'm' was not declared in this scope
    2 | using namespace std;int main(){int a,b,c,d,e,f,g,h[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(y==-1)break;g=f-c+h[mm]-h[m]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}return 0;}
      |                                                                                                                                                                   ^
Language: C++

#include <iostream>
using namespace std;main(){int a,b,c,d,e,f,g,h[]={,,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(a==-1)break;g=f-c+h[e]-h[b]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}}

Compiler output:
a.cc:2:21: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | using namespace std;main(){int a,b,c,d,e,f,g,h[]={,,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(a==-1)break;g=f-c+h[e]-h[b]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}}
      |                     ^~~~
a.cc: In function 'int main()':
a.cc:2:51: error: expected primary-expression before ',' token
    2 | using namespace std;main(){int a,b,c,d,e,f,g,h[]={,,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(a==-1)break;g=f-c+h[e]-h[b]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}}
      |                                                   ^
a.cc:2:52: error: expected primary-expression before ',' token
    2 | using namespace std;main(){int a,b,c,d,e,f,g,h[]={,,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(a==-1)break;g=f-c+h[e]-h[b]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}}
      |                                                    ^
Language: C++

import java.util.*;

public class Main {
    static final int[] days = {0,31,28,31,30,31,30,31,31,30,31,30,31};

    public static boolean isUruu(int y) {
	return (y%4 == 0 && y%100 != 0) || y%400 == 0;
    }

    public static int getDays(int y,int m,int d) {
	int res = 0;
	for(int i = 1; i <= y-1; ++i) {
	    if(isUruu(i)) res += 366;
	    else     res += 365;
	}
	for(int i = 1; i <= m-1; ++i) {
	    res += days[i];
	    if(i == 2 && isUruu(y)) ++res;
	}
	res += d;
	return res;
    }

    public static void main(String[] args) {
	Scanner s = new Scanner(System.in);
	while(true) {
	    int d[][] = new int[2][3];
	    boolean flag = false;
	    for(int i = 0; i < 2; ++i) {
		for(int j = 0; j < 3; ++j) {
		    d[i][j] = s.nextInt();
		    if(d[i][j] < 0) flag = true;
		}
	    }
	    if(flag) break;
	    System.out.println(Math.abs(getDays(d[1][0],d[1][1],d[1][2])-getDays(d[0][0],d[0][1],d[0][2])));
	}
    }
}

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

#include <cstdio>
int y1, m1, d1, y2, m2, d2;
int day[2][12]={
{31,28,31,30,31,30,31,31,30,31,30,31,31},
{31,29,31,30,31,30,31,31,30,31,30,31,31}
};
bool uruu(int year) {
    if (year%400==0) return true;
    else if (year%100==0) return false;
    else if (year%4==0) return true;
    else return false;
}
int main() {
    while (scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2)) {
        if (y1==-1&&m1==-1&&d1==-1&&y2==-1&&m2==-1&&d2==-1) break;
        int res = 0, flag;
        if (y1==y2) {
            if (uruu(y1)) flag = 1;
            else flag = 0;
            if (m1==m2) res = d2-d1;
            else {
                for (int i=m1; i<m2; i++) res += day[flag][i];
                res += day[flag][m1-1] - d1;
                res += d2;
            }
        } else {
            if (uruu(y1)) flag = 1;
            else flag = 0;
            for (int i=m1; i<12; i++) res += day[flag][i];
            res += day[flag][m1-1] - d1;
            for (int i=y1+1; i<y2; i++) {
                if (uruu(i)) res += 366;
                else res += 365;
            }
            if (uruu(y2)) flag = 1;
            else flag = 0;
            for (int i=0; i<m1-1; i++) res += day[flag][i];
            res += d2;
        }
        printf("%d\n", res);
    }
}

Compiler output:
a.cc:2:5: warning: built-in function 'y1' declared as non-function [-Wbuiltin-declaration-mismatch]
    2 | int y1, m1, d1, y2, m2, d2;
      |     ^~
a.cc:6:1: error: too many initializers for 'int [12]'
    6 | };
      | ^
Language: C++


  for(int i = 1 ; i < y ; i++) {
    day += 365;
    if(i % 4 == 0 && i % 100 != 0 || i % 400 == 0) day += 1;
      }

  for(int i = 1 ; i < m ; i++) {
    day += 30;
    if(i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) day++;
    if(i == 2)  day -= 2; //if(u) day++; }
  }
  for(int i = 0 ; i < d ; i++) {
    day++;
  }
  return day;
}

Compiler output:
a.cc:2:3: error: expected unqualified-id before 'for'
    2 |   for(int i = 1 ; i < y ; i++) {
      |   ^~~
a.cc:2:19: error: 'i' does not name a type
    2 |   for(int i = 1 ; i < y ; i++) {
      |                   ^
a.cc:2:27: error: 'i' does not name a type
    2 |   for(int i = 1 ; i < y ; i++) {
      |                           ^
a.cc:7:3: error: expected unqualified-id before 'for'
    7 |   for(int i = 1 ; i < m ; i++) {
      |   ^~~
a.cc:7:19: error: 'i' does not name a type
    7 |   for(int i = 1 ; i < m ; i++) {
      |                   ^
a.cc:7:27: error: 'i' does not name a type
    7 |   for(int i = 1 ; i < m ; i++) {
      |                           ^
a.cc:12:3: error: expected unqualified-id before 'for'
   12 |   for(int i = 0 ; i < d ; i++) {
      |   ^~~
a.cc:12:19: error: 'i' does not name a type
   12 |   for(int i = 0 ; i < d ; i++) {
      |                   ^
a.cc:12:27: error: 'i' does not name a type
   12 |   for(int i = 0 ; i < d ; i++) {
      |                           ^
a.cc:15:3: error: expected unqualified-id before 'return'
   15 |   return day;
      |   ^~~~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

2
2 1 3 4 5 6 7 8 9
4 5 6 7 8 9 1 2 3
7 8 9 1 2 3 4 5 6
2 3 4 5 6 7 8 9 1
5 6 7 8 9 1 2 3 4
8 9 1 2 3 4 5 6 7
3 4 5 6 7 8 9 1 2
6 7 8 9 1 2 3 4 5
9 1 2 3 4 5 6 7 8
2 1 3 4 5 6 7 8 9
4 5 6 7 8 9 1 2 3
7 8 9 1 2 3 4 5 6
2 3 4 5 6 7 8 9 1
5 6 7 8 9 1 2 3 4
8 9 1 2 3 4 5 6 7
3 4 5 6 7 8 9 1 2
6 7 8 9 1 2 3 4 5
9 1 2 3 4 5 6 7 8

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

#include <bits/std++.h>
 
using namespace std;

int puzzle[9][9];
 
void field(int x, int &to, int &from)
{
    if (0 <= x && x < 3) {
	to = 0;
	from = 3;
    } else if (3 <= x && x < 6) {
	to = 3;
	from = 6;
    } else {
	to = 6;
	from = 9;
    }
}
 
bool check1(int x, int y)
{
    for (int i = x-1; i >= 0; i--) {
	if (puzzle[x][y] == puzzle[i][y]) return 0;
    }
    for (int i = x+1; i < 9; i++) {
	if (puzzle[x][y] == puzzle[i][y]) return 0;
    }
    return 1;
}
 
bool check2(int x, int y)
{
    for (int i = y-1; i >= 0; i--) {
	if (puzzle[x][y] == puzzle[x][i]) return 0;
    }
    for (int i = y+1; i < 9; i++) {
	if (puzzle[x][y] == puzzle[x][i]) return 0;
    }
    return 1;
}
 
bool check3(int x, int y)
{
    int sx, tx, sy, ty;
 
    field(x, sx, tx);
    field(y, sy, ty);
    for (int i = sx; i < tx; i++) {
	for (int j = sy; j < ty; j++) {  
	    if (x == i && y == j) continue;
	    if (puzzle[x][y] == puzzle[i][j]) return 0;
	}
    }
    return 1;
}
 
int main()
{
    int T;
 
    cin >> T;
    for (int t = 0; t < T; t++) {
	if(t) cout << endl;
	for (int i = 0; i < 9; i++) {
	    for (int j = 0; j < 9; j++) {
		cin >> puzzle[i][j];
	    }
	}
 	char ch[9][9];
	for (int i = 0; i < 9; i++) {
	    for (int j = 0; j < 9; j++) {
		ch[i][j] = ' ';
	    }
	}
 	for (int i = 0; i < 9; i++) {
            for (int j = 0; j < 9; j++) {
		if (check1(i, j) && check2(i, j) && check3(i, j)) continue;
		ch[i][j] = '*';
	    }
	}
        for (int i = 0; i < 9; i++) {
	    for (int j = 0; j < 9; j++) {
		cout << ch[i][j] << puzzle[i][j];
	    }
	    cout << endl;
	}
    }
    return 0;
}

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

int main()
{
        //field : ????????°??¬?????¶???
        //used : ???????????????????????????????????????????????°?????????????????????
	int field[10][10], used[10];
        //judge : ??°??¬???????????£???????????¨?????????true???
	bool judge[10][10];

	int num;
	cin >> num;
	while(num--)
	{
		memset(judge, false, sizeof(judge));

		for(int i = 0; i < 9; i++)
		{
			for(int j = 0; j< 9; j++)
			{
				cin >> field[i][j];
			}
		}
		for(int i = 0; i < 9; i++)
		{
			memset(used, 0, sizeof(used));
			for(int j = 0; j < 9; j++)
			{
				used[field[i][j]]++;
			}
			for(int j = 1; j <=9; j++)
			{
				if(used[j] >= 2)
				{
					for(int k = 0; k < 9; k++)
					{
						if(field[i][k] == j)
						{
							judge[i][k] = true;
						}
					}
				}
			}
			memset(used, 0, sizeof(used));
			for(int j = 0; j < 9; j++)
			{
				used[field[j][i]]++;
			}
			for(int j = 1; j<= 9; j++)
			{
				if(used[j] >= 2)
				{
					for(int k = 0; k < 9; k++)
					{
						if(field[k][i] == j)
						{
							judge[k][i] = true;
						}
					}
				}
			}
		}

		for(int l = 0; l < 9; l+=3)
		{
			for(int m = 0; m < 9; m+=3)
			{
				memset(used, false, sizeof(used));
				for(int i = 0; i < 3; i++)
				{
					for(int j = 0; j < 3; j++)
					{
						used[field[i+l][j+m]]++;
					}
				}

				for(int n = 1; n <=9; n++)
				{
					if(used[n] >= 2)
					{
						for(int i = 0; i < 3; i++)
						{
							for(int j = 0; j < 3; j++)
							{
								if(field[i+l][j+m] == n)
								{
									judge[i+l][j+m] = true;
								}
							}
						}
					}
				}
			}
		}

		for(int i = 0; i < 9; i++)
		{
			for(int j = 0; j < 9; j++)
			{
				printf("%s%d",(judge[i][j])?"*":" " ,field[i][j]);
			}
			puts("");
		}
		if(num != 0)
		{
			puts("");
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'cin' was not declared in this scope
   10 |         cin >> num;
      |         ^~~
a.cc:13:17: error: 'memset' was not declared in this scope
   13 |                 memset(judge, false, sizeof(judge));
      |                 ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | int main()
a.cc:98:33: error: 'printf' was not declared in this scope
   98 |                                 printf("%s%d",(judge[i][j])?"*":" " ,field[i][j]);
      |                                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main()
a.cc:100:25: error: 'puts' was not declared in this scope
  100 |                         puts("");
      |                         ^~~~
a.cc:104:25: error: 'puts' was not declared in this scope
  104 |                         puts("");
      |                         ^~~~
Language: C++

#include<iostream>
int main()
{
        //field : ????????°??¬?????¶???
        //used : ???????????????????????????????????????????????°?????????????????????
	int field[10][10], used[10];
        //judge : ??°??¬???????????£???????????¨?????????true???
	bool judge[10][10];

	int num;
	cin >> num;
	while(num--)
	{
		memset(judge, false, sizeof(judge));

		for(int i = 0; i < 9; i++)
		{
			for(int j = 0; j< 9; j++)
			{
				cin >> field[i][j];
			}
		}
		for(int i = 0; i < 9; i++)
		{
			memset(used, 0, sizeof(used));
			for(int j = 0; j < 9; j++)
			{
				used[field[i][j]]++;
			}
			for(int j = 1; j <=9; j++)
			{
				if(used[j] >= 2)
				{
					for(int k = 0; k < 9; k++)
					{
						if(field[i][k] == j)
						{
							judge[i][k] = true;
						}
					}
				}
			}
			memset(used, 0, sizeof(used));
			for(int j = 0; j < 9; j++)
			{
				used[field[j][i]]++;
			}
			for(int j = 1; j<= 9; j++)
			{
				if(used[j] >= 2)
				{
					for(int k = 0; k < 9; k++)
					{
						if(field[k][i] == j)
						{
							judge[k][i] = true;
						}
					}
				}
			}
		}

		for(int l = 0; l < 9; l+=3)
		{
			for(int m = 0; m < 9; m+=3)
			{
				memset(used, false, sizeof(used));
				for(int i = 0; i < 3; i++)
				{
					for(int j = 0; j < 3; j++)
					{
						used[field[i+l][j+m]]++;
					}
				}

				for(int n = 1; n <=9; n++)
				{
					if(used[n] >= 2)
					{
						for(int i = 0; i < 3; i++)
						{
							for(int j = 0; j < 3; j++)
							{
								if(field[i+l][j+m] == n)
								{
									judge[i+l][j+m] = true;
								}
							}
						}
					}
				}
			}
		}

		for(int i = 0; i < 9; i++)
		{
			for(int j = 0; j < 9; j++)
			{
				printf("%s%d",(judge[i][j])?"*":" " ,field[i][j]);
			}
			puts("");
		}
		if(num != 0)
		{
			puts("");
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   11 |         cin >> num;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:14:17: error: 'memset' was not declared in this scope
   14 |                 memset(judge, false, sizeof(judge));
      |                 ^~~~~~
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 | int main()
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int math[9][9], jud[10] = {};
bool mmath[9][9];
void jj(int x, int y){
	int jud2[10][2];
	for(int i = 0; i < 10; i++){
		fill(jud2[i], jud2[i] + 2, -1);
	}
	for(int i = x; i < x + 3; i++){
		for(int j = y; j < y + 3; j++){
			if(jud2[math[i][j]][0] >= 0){
				mmath[i][j] = 1;
				mmath[jud2[math[i][j]][0]][jud2[math[i][j]][1]] = 1;;
			}
			jud2[math[i][j]][0] = i;
			jud2[math[i][j]][1] = j;
		}
	}
}
int main(){
	int n;
	cin >> n;
	for(int k = 0; k < n; k++){
		for(int i = 0; i < 9; i++)
			fill(mmath[i], mmath[i] + 9, 0);
		for(int i = 0; i < 9; i++){
			for(int j = 0; j < 9; j++){
				cin >> math[i][j];
			}
		}
		for(int i = 0; i < 9; i++){
			fill(jud, jud + 10, -1);
			for(int j = 0; j < 9; j++){
				if(jud[math[i][j]] >= 0){
					mmath[i][j] = 1;
					mmath[i][jud[math[i][j]]] = 1;
				}
				jud[math[i][j]] = j;
			}
		}
		for(int i = 0; i < 9; i++){
			fill(jud, jud + 10, -1);
			for(int j = 0; j < 9; j++){
				if(jud[math[j][i]] >= 0){
					mmath[j][i] = 1;
					mmath[jud[math[j][i]]][i] = 1;
				}
				jud[math[j][i]] = j;
			}
		}
		jj(0, 0);	jj(3, 0);	jj(6, 0);
		jj(0, 3);	jj(3, 3);	jj(6, 3);
		jj(0, 6);	jj(3, 6);	jj(6, 6);
		for(int i = 0; i < 9; i++){
			for(int j = 0; j < 9; j++){
				if(!mmath[i][j])
					cout << " ";
				else
					cout << "*"
				cout << math[i][j];
			}
			cout << endl;
		}
		cout << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:52: error: expected ';' before 'cout'
   61 |                                         cout << "*"
      |                                                    ^
      |                                                    ;
   62 |                                 cout << math[i][j];
      |                                 ~~~~