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

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <complex>

using namespace std;

#define INF 1 << 16

typedef complex<int> P;

int abs(int n) {
	return n < 0 ? -n : n;
}

int main() {
	int W, H;
	while (cin >> W >> H, W || H) {
		vector<P> v;
		vector<int> type;
		vector< vector<int> > m(7);

		for (int y = 0; y < H; ++y) {
			string str; cin >> str;
			for (int x = 0; x < W; ++x) {
				if (str[x] == '.') continue;

				v.push_back( P(x, y) );
				if (str[x] == 'S') type.push_back( 5 );
				else if (str[x] == 'G') type.push_back( 6 );
				else if (str[x] != '.') type.push_back( str[x] - '1' );

				m[type[type.size()-1]].push_back(v.size()-1);
			}
		}

		int f = false;
		for (int i = 0; i < 5; ++i)
			if ( !m[i].size() )
				f = true;

		if (f) {
			cout << "NA" << endl;
			continue;
		}

		vector< vector<int> > cost(v.size(), vector<int>(v.size(), INF));
		for (int i = 0; i < v.size(); ++i)
			for (int j = 0; j < v.size(); ++j)
				cost[i][j] = ;

		pair<int, int> ans = pair<int, int>(0, INF);
		for (int kind = 0; kind < 5; ++kind) {
			vector<int> len(v.size(), INF);

			vector<int> types;
			types.push_back(5);
			for (int i = 0; i < 4; ++i)
				types.push_back( (kind + i + 1) % 5 );

			types.push_back(6);

			len[m[5][0]] = 0;
			for (int i = 0; i < 5; ++i) {
				int now = types[i], next = types[i+1];
				for (int j = 0; j < m[next].size(); ++j)
					for (int k = 0; k < m[now].size(); ++k)
						if (len[m[next][j]] > len[m[now][k]] + abs(v[m[now][k]].real() - v[m[next][j]].real()) + abs(v[m[now][k]].imag() - v[m[next][j]].imag()))
							len[m[next][j]] = len[m[now][k]] + abs(v[m[now][k]].real() - v[m[next][j]].real()) + abs(v[m[now][k]].imag() - v[m[next][j]].imag());
			}

			if (len[m[6][0]] < ans.second)
				ans = pair<int, int>(kind+1, len[m[6][0]]);
		}

		cout << ans.first << " " << ans.second << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:46: error: expected primary-expression before ';' token
   51 |                                 cost[i][j] = ;
      |                                              ^
Language: C++

#include <cstdio>
#include <vector>
#include <utility>
#include <queue>
#include <algorithm>
using namespace std;
#define inf (1<<27)
#define abs(n) ((n)>=0?(n):-(n))
#define next(p) ((p)%5+1)
typedef pair<int,int> P;
typedef pair<int,P> P2;
int d[6][1000];
int o[6];
int dist(P &a,P &b) {return abs(a.first-b.first)+abs(a.second-b.second);}
int main() {
	int x,y;
	while(scanf("%d%d",&x,&y),x) {
		vector<P> p[7];
		for(int j=0;j<y;j++) {
			getchar();
			for(int i=0;i<x;i++) {
				char ch=getchar();
				if(ch=='S')p[0].push_back(P(i,j));
				if(ch=='G')p[6].push_back(P(i,j));
				if(ch!='.')p[ch-'0'].push_back(P(i,j));
			}
		}
		bool na=false;
		for(int i=0;i<7;i++)if(!p[i].size())na=true;
		if(na) {printf("NA\n");continue;}
		o[0]=0;o[5]=6;
		int ans=inf;
		for(int m=1;m<=5;m++) {
			for(int t=next(m),i=1;i<=4;i++,t=next(t))o[i]=t;
			fill(d[0],d[0]+6*1000,inf);
			d[0][0]=0;
			priority_queue<P,vector<P2>,greater<P2>> que;
			que.push(P2(0,P(0,0)));
			while(!que.empty()) {
				P2 p2=que.top();que.pop();
				if(d[p2.second.first][p2.second.second]<p2.first)continue;
				if((p2.second.first+1)>=6)continue;
				for(int i=0;i<p[o[p2.second.first+1]].size();i++) {
					if(d[p2.second.first+1][i]>p2.first+dist(p[o[p2.second.first]][p2.second.second],p[o[p2.second.first+1]][i])) {
						d[p2.second.first+1][i]=p2.first+dist(p[o[p2.second.first]][p2.second.second],p[o[p2.second.first+1]][i]);
						que.push(P2(p2.first+dist(p[o[p2.second.first]][p2.second.second],p[o[p2.second.first+1]][i]),P(p2.second.first+1,i)));
					}
				}
			}
			if(ans>d[5][0]) ans=d[5][0];
		}
		printf("%d\n",ans);
	}
}

Compiler output:
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_queue.h: In instantiation of 'class std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, std::pair<int, int> > >, std::greater<std::pair<int, std::pair<int, int> > > >':
a.cc:37:45:   required from here
   37 |                         priority_queue<P,vector<P2>,greater<P2>> que;
      |                                                                  ^~~
/usr/include/c++/14/bits/stl_queue.h:520:67: error: static assertion failed: value_type must be the same as the underlying container
  520 |       static_assert(is_same<_Tp, typename _Sequence::value_type>::value,
      |                                                                   ^~~~~
/usr/include/c++/14/bits/stl_queue.h:520:67: note: 'std::integral_constant<bool, false>::value' evaluates to false
Language: C++

#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<cstring>
#define INF 1<<28
using namespace std;

int sx, sy, gx, gy;
typedef pair < int, int > P;
vector < P > p[5];
int memo[5][5][1111];
int a, b;

int solve(int k, int t, int q){

  if(k == 4) return abs(p[t][q].F-gx) + abs(p[t][q].S-gy);
  if(memo[k][t][q]) return memo[k][t][q];

  int ans = INF, d = (t+1)%5, s;
  for(int i=0;i<p[d].size();i++){
    if(!k) s = abs(sx-p[d][i].first) + abs(sy-p[d][i].second);
    else s = abs(p[t][q].F-p[d][i].first) + abs(p[t][q].S-p[d][i].second);
    ans = min(ans, solve(k+1, d, i) + s);
  }

  return memo[k][t][q] = ans;
}

int main(){

  int w,h;
  char c;

  while(true){
    cin >> w >> h;
    if(!w && !h) break;

    for(int i=0;i<5;i++) p[i].clear();
    
    for(int i=0;i<h;i++){
      for(int j=0;j<w;j++){
	cin >> c;
	if(c == 'S') sx = j, sy = i;
	if(c == 'G') gx = j, gy = i;
	else if(c != '.') p[c-'1'].push_back(P(j,i));
      }
    }
    
    b = INF;
    for(int i=0;i<5;i++){
      memset(memo, 0, sizeof(memo));
      if(b > solve(0,i,0)) a = i, b = solve(0,i,0);
    }

    if(b == INF) cout << "NA\n";
    else cout << a+1 << " " << b << endl;

  }
}

Compiler output:
a.cc: In function 'int solve(int, int, int)':
a.cc:17:33: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'F'
   17 |   if(k == 4) return abs(p[t][q].F-gx) + abs(p[t][q].S-gy);
      |                                 ^
a.cc:17:53: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'S'
   17 |   if(k == 4) return abs(p[t][q].F-gx) + abs(p[t][q].S-gy);
      |                                                     ^
a.cc:23:26: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'F'
   23 |     else s = abs(p[t][q].F-p[d][i].first) + abs(p[t][q].S-p[d][i].second);
      |                          ^
a.cc:23:57: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'S'
   23 |     else s = abs(p[t][q].F-p[d][i].first) + abs(p[t][q].S-p[d][i].second);
      |                                                         ^
Language: Java

import java.util.Scanner;
public class P01{

public P01(){
Scanner scan = new Scanner(System.in)
for(int w; scan.hasNextInt() && w >= 0;){
 System.out.println( 4280-getCost(w));
}
}
public int getCost(int w){
 int cost = 1150; // ?¬¬?????????
 for (int i = 11; i <= w; i++ ){
 if ( i <= 20 ) cost += 125; // ?¬¬?????????
 else if ( 30 < i ) cost += 160; // ?¬¬?????????
 else cost += 140; // ?¬¬?????????
 }
 return cost;
}
public static void main(String[] args){
 P01 p01 = new P01();
 }
}

Compiler output:
Main.java:5: error: ';' expected
Scanner scan = new Scanner(System.in)
                                     ^
1 error
Language: Java

import java.util.Scanner;
public class P01{

public P01(){
Scanner scan = new Scanner(System.in)
for(int w; scan.hasNextInt() && w >= 0;){
 System.out.println( 4280-getCost(w));
}
}
public int getCost(int w){
 int cost = 1150;
 for (int i = 11; i <= w; i++ ){
 if ( i <= 20 ) cost += 125;
 else if ( 30 < i ) cost += 160;
 else cost += 140;
 }
 return cost;
}
public static void main(String[] args){
 P01 p01 = new P01();
 }
}

Compiler output:
Main.java:5: error: ';' expected
Scanner scan = new Scanner(System.in)
                                     ^
1 error
Language: C

#include<iostream>
using namespace std;
int getCost(int w){
 int cost = 1150; // ?¬¬?????????
 for (int i = 11; i <= w; i++ ){
 if ( i <= 20 ) cost += 125; // ?¬¬?????????
 else if ( 30 < i ) cost += 160; // ?¬¬?????????
 else cost += 140; // ?¬¬?????????
 }
 return cost;}
int main(){
 for( int w; cin >> w && w >= 0; ) {
 cout << 4280 - getCost(w) << endl;
 }
 return 0;
}

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

#include<iostream>
using namespace std;
int getCost(int w){
 int cost = 1150; // ?¬¬?????????
 for (int i = 11; i <= w; i++ ){
 if ( i <= 20 ) cost += 125; // ?¬¬?????????
 else if ( 30 < i ) cost += 160; // ?¬¬?????????
 else cost += 140; // ?¬¬?????????
 }
 return cost;
}
int main(){
 for( int w; cin >> w && w >= 0; ) {
 cout << 4280 - getCost(w) << endl;
 }
 return 0;
}

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

#include<iostream>
using namespace std;
int getCost(int w){
 int cost = 1150; // ?¬¬?????????
 for (int i = 11; i <= w; i++ ){
 if ( i <= 20 ) cost += 125; // ?¬¬?????????
 else if ( 30 < i ) cost += 160; // ?¬¬?????????
 else cost += 140; // ?¬¬?????????
 }
 return cost;
}
int main(){
 for( int w; cin >> w && w >= 0; ) {
 cout << 4280 - getCost(w) << endl;
 }
 return 0;
}
?§£??????(

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

#include<stdio.h>
int main(void)
{
int a,d=1150;
while(scanf("%d",&a),a!=-1){
if(a>30){
d=d+160*(a-30);
a=30;
}
if(a>20){
d=d+140*(a-20);
a=20;
}
if(a>10)
d=d+140*(a-10);
d=10;
}
if(a<=10){
printf("%d?\n",d-4280);
}
}
return 0;
}

Compiler output:
main.c:22:1: error: expected identifier or '(' before 'return'
   22 | return 0;
      | ^~~~~~
main.c:23:1: error: expected identifier or '(' before '}' token
   23 | }
      | ^
Language: C

#include <stdio.h>
int main()
{
	int b,c,d,e,w,e,f;
	int x;
	for(;;){
	scanf("%d",&w);
	if(w==-1){
		break;
	}
	if(w<=10){
	b=1150;
	}
	else if(w>10&&w<=20){
		d=w-10;
	b=1150+d*125;
	}
	else if(w>20&&w<=30){
		e=w-20;
		b=1150+1250+e*140;
	}
	else if(w>30){
		f=w-30;
		b=1150+1250+1400+f*160;
	}
	c=4280-b;
	printf("%d\n",c);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:23: error: redeclaration of 'e' with no linkage
    4 |         int b,c,d,e,w,e,f;
      |                       ^
main.c:4:19: note: previous declaration of 'e' with type 'int'
    4 |         int b,c,d,e,w,e,f;
      |                   ^
Language: C

main(w,s){for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(w,s){for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      | ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'w' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 's' defaults to 'int' [-Wimplicit-int]
main.c:1:23: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | main(w,s){for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      |                       ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(w,s){for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
main.c:1:23: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | main(w,s){for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      |                       ^~~~~
main.c:1:23: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:41: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | main(w,s){for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      |                                         ^~~~~~
main.c:1:41: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:41: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:41: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:109: error: lvalue required as left operand of assignment
    1 | main(w,s){for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      |                                                                                                             ^~
Language: C

main(){for(int w,s;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){for(int w,s;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      | ^~~~
main.c: In function 'main':
main.c:1:27: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | main(){for(int w,s;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      |                           ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(){for(int w,s;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
main.c:1:27: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | main(){for(int w,s;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      |                           ^~~~~
main.c:1:27: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:45: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | main(){for(int w,s;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      |                                             ^~~~~~
main.c:1:45: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:45: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:45: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:113: error: lvalue required as left operand of assignment
    1 | main(){for(int w,s;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      |                                                                                                                 ^~
Language: C

main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      | ^~~~
main.c: In function 'main':
main.c:1:28: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      |                            ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
main.c:1:28: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      |                            ^~~~~
main.c:1:28: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:46: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      |                                              ^~~~~~
main.c:1:46: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:46: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:46: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:114: error: lvalue required as left operand of assignment
    1 | main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      |                                                                                                                  ^~
Language: C

int main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}

Compiler output:
main.c: In function 'main':
main.c:1:32: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | int main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      |                                ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
main.c:1:32: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | int main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      |                                ^~~~~
main.c:1:32: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:50: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | int main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      |                                                  ^~~~~~
main.c:1:50: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:50: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:50: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:118: error: lvalue required as left operand of assignment
    1 | int main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      |                                                                                                                      ^~
Language: C

#include <iostream>

int main(){
	int w;
	while(std::cin >> w, w+1){
		int p = 1150;
		if(w > 30)p += 2650 + (w-30) * 160;
		else if(w > 20)p += 1250 + (w-20) * 140;
		else if(w > 10)p += (w-10) * 125;
		std::cout << 4280 - p << std::endl;
	}
}

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

#include<stdio.h>

int main(){
	int w;
	int m = 1150;
	int t;
	do{
		scanf("%d", &w);
		t = w;
		t -= 30;
		}
		
		if(w > 30){
			m += 10 * 125 + 10 * 140 + t * 160;
		}else if(w > 20){
			t = w - 20;
			m += 10 * 125 + t *140;
		}else if(w > 10){
			t = w - 10;
			m += r * 125;
		}else{
			m = m;
		}
	printf("%d\n", 4280 - m);
	}while(scanf("%d", w) != -1);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:17: error: expected 'while' before 'if'
   13 |                 if(w > 30){
      |                 ^~
main.c:15:18: error: 'else' without a previous 'if'
   15 |                 }else if(w > 20){
      |                  ^~~~
main.c:20:30: error: 'r' undeclared (first use in this function)
   20 |                         m += r * 125;
      |                              ^
main.c:20:30: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:25:10: error: expected identifier or '(' before 'while'
   25 |         }while(scanf("%d", w) != -1);
      |          ^~~~~
main.c:26:9: error: expected identifier or '(' before 'return'
   26 |         return 0;
      |         ^~~~~~
main.c:27:1: error: expected identifier or '(' before '}' token
   27 | }
      | ^
Language: C

#include <iostream>
using namespace std;

int main(){
int w,money,flag,i;
    while(1){
        money = 1150;
        cin >> w;
        if(w == -1){
            break;
        }
        if(w <= 10){
            cout << 4280 - money << endl;
        }
        else {
            w -= 10;
            flag = 9;
            for(i=w;i>=1;i--){
                flag++;
                if(flag < 20){
                    money += 125;
                }
                else if(flag < 30){
                    money += 140;
                }
                else if(flag < 40){
                    money += 160;
                }
            }
            cout << 4280 - money << endl;
        }
    }
}

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

include<stdio.h>
main(){
  int i,w,en=0,flg;
  while(1){
    scanf("%d",&w);
    if(w==-1)break;
    for(i=11,en=1150;i<=w;i++){
      if(i<=20)en+=125;
      else if(i<=30)en+=140;
      else en+=160;
    }
    printf("%d\n",4280-en);
  }
  return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

#include <stdio.h>

int main(void)
{
	int w, a;
	
	while(scanf("%d", &w) != EOF && w != -1){
		
		int rates = 1150;
		
		if(w > 30){
			rates += (1250 + 1400);
			
			if()
				rates += (w - 30) * 160;
		}
		else{
			if(w > 20){
				rates += 1250;
				rates += (w % 20) * 140;
			}
			if(10 < w && w < 20){
				rates += (w % 10) * 125;
			}
		}
		
		printf("%d\n", 4280 - rates);
	}
		
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:28: error: expected expression before ')' token
   14 |                         if()
      |                            ^
Language: C++

#include<iostream>
using namespace srd;

int main(){
	int w,r;
	while(1){
	cin >> w;
	if(w<=10)r = 4280-1150;
	else if(10<w<=20)r = 4280 - (1150 + (w-10) * 125);
	else if(20<w<=30)r = 4280 - (1150 + 1250 + (w-20) * 140);
	else if(30<w)r = 4280 - (1150 + 1250 + 1400 + (w-20) * 160);

	else if(w==-1)break;

	cout << r << "\n";
	}

	return 0;
	}

Compiler output:
a.cc:2:17: error: 'srd' is not a namespace-name
    2 | using namespace srd;
      |                 ^~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin >> w;
      |         ^~~
      |         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:15:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |         cout << r << "\n";
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

def water_charges(w):
    progressive_rate = {
    (float('inf'),30):160,
              (30,20):140,
              (20,10):125,
              (10, 0):0}

    charge = basic_charge = 1150
    for (upper, lower), rate in progressive_rate.items():
        usage = min(w, upper) - lower
        if 0 < usage:
            charge += usage * rate
            
    return charge

import sys
f = sys.stdin

last_water_charges = 4280
while True:
    w = int(f.readline())
    if w == -1:
        break
    print(last_water_charges - water_charges(w))

Compiler output:
a.cc:3:12: warning: multi-character character constant [-Wmultichar]
    3 |     (float('inf'),30):160,
      |            ^~~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def water_charges(w):
      | ^~~
a.cc:8:5: error: 'charge' does not name a type; did you mean 'char'?
    8 |     charge = basic_charge = 1150
      |     ^~~~~~
      |     char
Language: C++

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

int w,sum;
string str;

int main(){
	while(1){
		cin>>>w;
		if(w==-1){break;}
		if(w<=10){cout<<4280-1150<<endl;}
		else if(w<=20){cout<<4280-(1150+(w-10)*125)<<endl;}
		else if(w<=30){cout<<4280-(1150+1250+(w-20)*140)<<endl;}
		else {cout<<4280-(1150+1250+1400+(w-30)*160)<<endl;}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: expected primary-expression before '>' token
   12 |                 cin>>>w;
      |                      ^
Language: C++

#include<iostream>
using namespace std;
int getCost(int w){
 int cost = 1150; // ?¬¬?????????
 for (int i = 11; i <= w; i++ ){
 if ( i <= 20 ) cost += 125; // ?¬¬?????????
 else if ( 30 < i ) cost += 160; // ?¬¬?????????
 else cost += 140; // ?¬¬?????????
 }
 return cost;

Compiler output:
a.cc: In function 'int getCost(int)':
a.cc:10:14: error: expected '}' at end of input
   10 |  return cost;
      |              ^
a.cc:3:19: note: to match this '{'
    3 | int getCost(int w){
      |                   ^
Language: C++

import java.util.Scanner;
public class P01{

public P01(){
Scanner scan = new Scanner(System.in)
for(int w; scan.hasNextInt() && w >= 0;){
 System.out.println( 4280-getCost(w));
}
}
public int getCost(int w){
 int cost = 1150; // ?¬¬?????????
 for (int i = 11; i <= w; i++ ){
 if ( i <= 20 ) cost += 125; // ?¬¬?????????
 else if ( 30 < i ) cost += 160; // ?¬¬?????????
 else cost += 140; // ?¬¬?????????
 }
 return cost;
}
public static void main(String[] args){
 P01 p01 = new P01();
 }
}

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

#include<stdio.h>
int main(void)
{
		int n,t,i,k,j,g,s;
	while(1)	{
		scanf("%d",&t);
		if(t==-1)	break;
		if(10>=t){
			y=4280-1150;
			printf("%d\n",y);
			}
		if(t>10&&t<20){
			n=t-10;
			i=4280-(n*125+1150);
			printf("%d\n",i);
			}
		if(t>20&&t<30){
			k=t-20;
			j=4280-((k*140)+2400);
			printf("%d\n",j);
		}
		 if(t>30){
			s=t-30;
			g=4280-((s*160)+3800);
			printf("%d\n",g);
		}	
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:25: error: 'y' was not declared in this scope
    9 |                         y=4280-1150;
      |                         ^
Language: C++

#include<iostream>
using namespace std;
int getCost(int w){
int cost = 1150; 
for (int i = 11; i <= w; i++ ){
if ( i <= 20 ) cost += 125; 
else if ( 30 < i ) cost += 160; 
else cost += 140; 
}
return cost;

Compiler output:
a.cc: In function 'int getCost(int)':
a.cc:10:13: error: expected '}' at end of input
   10 | return cost;
      |             ^
a.cc:3:19: note: to match this '{'
    3 | int getCost(int w){
      |                   ^
Language: C++

main(n){for(;scanf("%d",&n)+n;printf("%d\n",(n<11?626:n<21?886-n*25:n<31?936-n*28:1056-n*32)*5));}

Compiler output:
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
    1 | main(n){for(;scanf("%d",&n)+n;printf("%d\n",(n<11?626:n<21?886-n*25:n<31?936-n*28:1056-n*32)*5));}
      |     ^
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;


int kakaku(n){
	int value=0;
	value+=1150;
	n-=10;
	if(n>0)value+=125*n;
	n-=10
	if(n>0)value+=15*n;
	n-=10;
	if(n>0)value+=20*n;
	return value;
}

int main(){
	int sui,sen,kon;
	
	cin>>sui;
	if(sui==-1)return ;
	sen=kakaku(sui);
	
	
	while(cin>>sui){
		if(sui==-1)break;
		kon=kakaku(sui);
		cout<<kon-sen<<endl;
		sen=kon;
	}
	return 0;
}

Compiler output:
a.cc:25:12: error: 'n' was not declared in this scope; did you mean 'yn'?
   25 | int kakaku(n){
      |            ^
      |            yn
a.cc: In function 'int main()':
a.cc:41:20: error: return-statement with no value, in function returning 'int' [-fpermissive]
   41 |         if(sui==-1)return ;
      |                    ^~~~~~
a.cc:42:19: error: 'kakaku' cannot be used as a function
   42 |         sen=kakaku(sui);
      |             ~~~~~~^~~~~
a.cc:47:27: error: 'kakaku' cannot be used as a function
   47 |                 kon=kakaku(sui);
      |                     ~~~~~~^~~~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;


int kakaku(int n){
	int value=0;
	value+=1150;
	n-=10;
	if(n>0)value+=125*n;
	n-=10
	if(n>0)value+=15*n;
	n-=10;
	if(n>0)value+=20*n;
	return value;
}

int main(){
	int sui,sen,kon;
	
	cin>>sui;
	if(sui==-1)return ;
	sen=kakaku(sui);
	
	
	while(cin>>sui){
		if(sui==-1)break;
		kon=kakaku(sui);
		cout<<kon-sen<<endl;
		sen=kon;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int kakaku(int)':
a.cc:30:14: error: expected ';' before 'if'
   30 |         n-=10
      |              ^
      |              ;
   31 |         if(n>0)value+=15*n;
      |         ~~    
a.cc: In function 'int main()':
a.cc:41:20: error: return-statement with no value, in function returning 'int' [-fpermissive]
   41 |         if(sui==-1)return ;
      |                    ^~~~~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;


int kakaku(int n){
	int value=0;
	value+=1150;
	n-=10;
	if(n>0)value+=125*n;
	n-=10;
	if(n>0)value+=15*n;
	n-=10;
	if(n>0)value+=20*n;
	return value;
}

int main(){
	int sui,sen,kon;
	
	cin>>sui;
	if(sui==-1)return ;
	sen=kakaku(sui);
	
	
	while(cin>>sui){
		if(sui==-1)break;
		kon=kakaku(sui);
		cout<<kon-sen<<endl;
		sen=kon;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:20: error: return-statement with no value, in function returning 'int' [-fpermissive]
   41 |         if(sui==-1)return ;
      |                    ^~~~~~
Language: C++

clude <iostream>
using namespace std;

int main()
{
    int n;
    while(cin >> n && (n >=0))  {
        int sum = 1150;
        if(n > 10 && n <= 20)
            sum += (n - 10) * 125;
        if(n > 20 && n <= 30)
            sum += 10 * 125 + (n - 20) * 140;
        if(n > 30)
            sum += 10 * 125 + 10 * 140 + (n - 30) * 160;
        cout << 4280 - sum << endl; 
    }
}

Compiler output:
a.cc:1:1: error: 'clude' does not name a type
    1 | clude <iostream>
      | ^~~~~
a.cc: In function 'int main()':
a.cc:7:11: error: 'cin' was not declared in this scope
    7 |     while(cin >> n && (n >=0))  {
      |           ^~~
a.cc:15:9: error: 'cout' was not declared in this scope
   15 |         cout << 4280 - sum << endl;
      |         ^~~~
a.cc:15:31: error: 'endl' was not declared in this scope
   15 |         cout << 4280 - sum << endl;
      |                               ^~~~
Language: C++

main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:28: error: 'scanf' was not declared in this scope
    1 | main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      |                            ^~~~~
a.cc:1:46: error: 'printf' was not declared in this scope
    1 | main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
      |                                              ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
Language: C++

#include<iostream>
using namespace std;
 
int main(){
int n, bill;
 
while(cin>>n,~n){
bill = 1150;
n-=10;
if(n<0)n=0;
if(n>10){bill += 125*10; n -= 10;}
else{bill += 125*n; n = 0;}
if(n>10){bill += 140*10; n -= 10;}
else{bill += 140*n; n = 0;}
bill += 160*n;
 
cout<<4280bill<<endl;
}
 
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:7: error: unable to find numeric literal operator 'operator""bill'
   17 | cout<<4280bill<<endl;
      |       ^~~~~~~~
Language: C++

main(){
	int w, p;
	while(scanf("%d", &w), w+1){
		p = 3130;
		if(w > 30)p -= 2650 + (w-30) * 160;
		else if(w > 20)p -= 1250 + (w-20) * 140;
		else if(w > 10)p -= (w-10) * 125;
		printf("%d\n", p);
	}
}

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

#include<iostream>
#include<cstdio>
using namespace std;
 
int main(void)
{
  while(1){
    int rate;
    cin >> rate;
    if(rate == -1) break;
    else{
      if(rate==0){
        rate==0;
      }
      else{
        rate-=10;
      }
      while(1){
        if(rate >=0 && rate < 10){
          rate*=125;
          break;
        }else if(rate >= 10 && rate < 20){
          rate-=10;
          rate*=140;
          rate+=1250;
          break;
        }else if(rate >= 20 && rate < 30){
          rate-=20;
          rate*=160;
          rate+=2650;
          break;
        }else if(rate >= 30){
        rate = 4250;
      }
      rate+=1150;
      cout << 4280-rate << endl;
    }
  }
}

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

class Pair
{
	int num;
	int walk;
	Pair(int num, int walk)
	{
		this.num = num;
		this.walk = walk;
	}
}
public class Main 
{
	
	public static void main(String[] args) 
	{
		Scanner stdIn = new Scanner(System.in);
		while(stdIn.hasNext())
		{
			int n = stdIn.nextInt();
			if(n == 0)
			{
				break;
			}
			List<Pair> list = new ArrayList<Pair>();
			for(int i = 0; i < n; ++i)
			{
				int num = stdIn.nextInt();
				int day1 = stdIn.nextInt();
				int day2 = stdIn.nextInt();
				list.add(new Pair(num, day1 + day2));
			}
			Collections.sort(list, new Comparator<Pair>()
			{ 
				public int compare(Pair t1, Pair t2)
				{
					return (t1.walk - t2.walk); 
				}
			} );
			System.out.println(list.get(list.size() - 1).num + " " + list.get(list.size() - 1).walk);
		}
	}
}

Compiler output:
Main.java:16: error: cannot find symbol
		Scanner stdIn = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:16: error: cannot find symbol
		Scanner stdIn = new Scanner(System.in);
		                    ^
  symbol:   class Scanner
  location: class Main
Main.java:24: error: cannot find symbol
			List<Pair> list = new ArrayList<Pair>();
			^
  symbol:   class List
  location: class Main
Main.java:24: error: cannot find symbol
			List<Pair> list = new ArrayList<Pair>();
			                      ^
  symbol:   class ArrayList
  location: class Main
Main.java:32: error: cannot find symbol
			Collections.sort(list, new Comparator<Pair>()
			                           ^
  symbol:   class Comparator
  location: class Main
Main.java:32: error: cannot find symbol
			Collections.sort(list, new Comparator<Pair>()
			^
  symbol:   variable Collections
  location: class Main
6 errors
Language: Java

import java.util.Scanner;

public class Main{
    public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
	int n,p,d1,d2,maxp,maxv;
	while(stdIn.hasNextInt()){
	    n = stdIn.nextInt();
	    if(n == 0) break;
	    maxp = maxv = 0;
	    for(int i = 0;i < n;i++){
		p = stdIn.nextInt();
		d1 = stdIn.nextInt();
		d2 = stdIn.nextInt();
		if(maxv < d1+d2){
		    maxp = p;
		    maxv = d1 + d2;
		}
	    }
	    System.out.printf(maxp,maxv);
	}
    }
}

Compiler output:
Main.java:20: error: no suitable method found for printf(int,int)
	    System.out.printf(maxp,maxv);
	              ^
    method PrintStream.printf(String,Object...) is not applicable
      (argument mismatch; int cannot be converted to String)
    method PrintStream.printf(Locale,String,Object...) is not applicable
      (argument mismatch; int cannot be converted to Locale)
1 error
Language: C

#include<stdio.h>
int main(void){
   int n,p,best,No,i,d1[1000],d2[1000];
   scanf("%d %d %d %d",&n,&p,&d1[0],&d2[0]);
   best=d1[0]+d2[0];
   No=p;
   for(i=1;i<n;i++){
      scanf("%d %d %d",&p,&d1[i],&d2[i]);
      if(best<d1[i]+d2[i]){
      best=d1[i]+d2[i];
      No=p;
   }
   printf("%d %d\n",No,best);
   return 0;
}

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

#include<stdio.h>
int main(void){
   int n,p,best,No,sum,i,d1[1000],d2[1000];
   scanf("%d %d %d %d",&n,&p,&d1[0],&d2[0]);
   best=d1[0]+d2[0];
   No=p;
   for(i=1;i<n;i++){
      scanf("%d %d %d",&p,&d1[i],&d2[i]);
      sum=d1[i]+d2[i];
      if(best<sum){
      best=sum;
      No=p;
   }
   printf("%d %d\n",No,best);
   return 0;
}

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

#include<stdio.h>

int P[10001][2]={0};

void reset(int x[][]);

int main(){
	int n,max=0,save;
	
	int c,d1,d2;
	
	while(scanf("%d",&n)!=EOF){
		if(n==0) {break;}
		
		for(c=0;c<n;c++){
			scanf("%d %d %d",&P[c][0],&d1,&d2);
			
			P[c][1]=d1+d2;
		}
		
		for(c=0;c<n;c++){
			if(P[c][1]>max){max=P[c][1];save=c;}
		}
		
		printf("%d %d\n",P[save][0],P[save][1]);
		
		int a,b;
		for(a=0;a<10001;a++){
			for(b=0;b<2;b++){
			P[a][b]=0;
			}
		}
	}
	return 0;
}
	
	

Compiler output:
main.c:5:16: error: array type has incomplete element type 'int[]'
    5 | void reset(int x[][]);
      |                ^
main.c:5:16: note: declaration of 'x' as multidimensional array must have bounds for all dimensions except the first
Language: C

m;
main(n,p,d,e,b)
{
for(;;)
  {
    scanf("%d",&n);
    if(!n)exit(0);
    for(;n--;m=0)
      {
	scanf("%d%d%d",&p,&d,&e);
	if(m<d+e)
	  m=d+e,b=p;
      }
    printf("%d %d\n",b,m);
  }

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | m;
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(n,p,d,e,b)
      | ^~~~
main.c: In function 'main':
main.c:2:1: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'p' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'd' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'e' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:6:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |     scanf("%d",&n);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | m;
main.c:6:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |     scanf("%d",&n);
      |     ^~~~~
main.c:6:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:7:11: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
    7 |     if(!n)exit(0);
      |           ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | m;
main.c:7:11: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
    7 |     if(!n)exit(0);
      |           ^~~~
main.c:7:11: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:14:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   14 |     printf("%d %d\n",b,m);
      |     ^~~~~~
main.c:14:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:14:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:3: error: expected declaration or statement at end of input
   15 |   }
      |   ^
Language: C

#include<stdio.h>
int main(void)
{
	int n;
	int p,d1,d2,MAX=0;
	1<=n && n<=10000;
	1<=p && p<=10000;
	0<=d1 && d1<=5000;
	0<=d2 && d2<=5000;
	d=d1+d2;
	scanf("%d",&n);
	while(n!=0) {
		for(i=1;i<=n;i++) {
			printf("Dataを入力してください\n");
			scanf("%d %d %d",&p,&d1,&d2);
			if((d1+d2) > MAX) {
				(d1+d2)=MAX;
			}
		}
		printf("%d %d %d\n",&p,&(d1+d2));
	scanf("%d",&n);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:9: error: 'd' undeclared (first use in this function); did you mean 'd2'?
   10 |         d=d1+d2;
      |         ^
      |         d2
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:21: error: 'i' undeclared (first use in this function)
   13 |                 for(i=1;i<=n;i++) {
      |                     ^
main.c:17:40: error: lvalue required as left operand of assignment
   17 |                                 (d1+d2)=MAX;
      |                                        ^
main.c:20:40: error: lvalue required as unary '&' operand
   20 |                 printf("%d %d %d\n",&p,&(d1+d2));
      |                                        ^
Language: C

#include<stdio.h>
int main(void)
{
	int n;
	int p,d1,d2,d,MAX=0;
	1<=n && n<=10000;
	1<=p && p<=10000;
	0<=d1 && d1<=5000;
	0<=d2 && d2<=5000;
	d=d1+d2;
	scanf("%d",&n);
	while(n!=0) {
		for(i=1;i<=n;i++) {
			printf("Dataを入力してください\n");
			scanf("%d %d %d",&p,&d1,&d2);
			if((d1+d2) > MAX) {
				(d1+d2)=MAX;
			}
		}
		printf("%d %d %d\n",&p,&d);
	scanf("%d",&n);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:21: error: 'i' undeclared (first use in this function)
   13 |                 for(i=1;i<=n;i++) {
      |                     ^
main.c:13:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:40: error: lvalue required as left operand of assignment
   17 |                                 (d1+d2)=MAX;
      |                                        ^
Language: C++

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

int main() {
    int n;
    while (cin >> n, n) {
        vector<pair<int,int> > v;
        int p, d1, d2;
        for (int i=0; i<n; ++i) {
            cin >> p >> d1 >> d2;
            v.push_back(make_pair(-d1-d2, p));
        }
        sort(v.begin(), v.end());
        cout << v[i].second << " " << -v[i].first << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: 'i' was not declared in this scope
   18 |         cout << v[i].second << " " << -v[i].first << endl;
      |                   ^
Language: C++

#include<iostream>
#include<algorithm>
#include<functional>
using namespace std;
int main(){
	int n;
	while(cin>>n,n){
		int ans=0,most=-1,tmp,t1,t2;
		for(int i=0;i<n;i++){
			cin>>tmp>>t1>>t2;
			if(most<t1+t2){
				most=t1+t2;
				ans=tmp;
			}
		}
		cout<<ans<<" "<<most<<endl;
	}
	return INT_MIN;
}

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

#include<stdio.h>

int main(){

int x,y,z,N,p;
int max=0.sum=0;

while(1){
scanf("%d",&N);if(N==0)break;
for(int i=0;i<N;i++){
scanf("%d %d %d",&p,&x,&y);
if(max<x+y){max=x+y;sum=p;}
}
printf("%d %d\n",sum,max);
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: unable to find numeric literal operator 'operator""sum'
    6 | int max=0.sum=0;
      |         ^~~~~
a.cc:12:21: error: 'sum' was not declared in this scope
   12 | if(max<x+y){max=x+y;sum=p;}
      |                     ^~~
a.cc:14:18: error: 'sum' was not declared in this scope
   14 | printf("%d %d\n",sum,max);
      |                  ^~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
struct patient{
  int p, d, dd;
  bool operator<(const patient &p)const{
    return d + dd < p.d + p.dd;
  }
  bool operator>(const patient &p)const{
    return d + dd > p.d + p.dd;
  }
};


int main(int argc, char *argv[]){
  int n;
  while(std::cin >> n, n){
    vector<patient> vp;
    for (int i = 0; i < n; i++) {
      patient p;
      std::cin >> p.p >> p.d >> p.dd;
      vp.push_back(p);
    }
    sort(vp.begin(), vp.end(), greater<patient>());
    std::cout << vp[0].p << " " << vp[0].d + vp[0].dd << std::endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   24 |     sort(vp.begin(), vp.end(), greater<patient>());
      |     ^~~~
      |     short
Language: C++

#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt"
int main() {
	while (1) {
		int  N; cin >> N;
		if (!N)break;
		int amax = -1;
		int id = 0;
		for (int i = 0; i < N; ++i) {
			int p, d1, d2; cin >> p >> d1 >> d2;
			if (amax < d1 + d2) {

				id = p;
				amax = d1 + d2;
			}

		}
		cout << id<< " "<<amx<< endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:35: error: 'amx' was not declared in this scope; did you mean 'amax'?
   27 |                 cout << id<< " "<<amx<< endl;
      |                                   ^~~
      |                                   amax