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

#include<stdio>

int main(void){
int t,n,s,f,i,j;

while(scanf("%d",&t)&&t!=0){
for(i=0;i<t;i++){
scanf("%d",&n);
for(j=0;j<n;j++){
scanf("%d%d",&s,&f);
t=t-s+f;
}
if(t>0){
printf("%d\n",t);}
else{
printf("OK\n");}
}
}
return 0;
}

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

#include<stdio.h>
int main(void) {
	int t, n=0, s, f, z=0,i;
	scanf("%d", &t);
	while (1) {
		if (n == 0)break;
		scanf("%d", &n);
		for (i = 0;i < n;i++) {
			scanf_s("%d %d", &s, &f);
			z += f - s;
		}
		if (z >= t) {
			printf("OK\n");
		}
		else {
			printf("%d\n",t - z);
		}
	}return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:25: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    9 |                         scanf_s("%d %d", &s, &f);
      |                         ^~~~~~~
      |                         scanf
Language: C

#include<stdio.h>
int main(void) {
	int t, n=0, s, f, z=0,i;
	scanf_s("%d", &t);
	while (1) {
		if (n == 0)break;
		scanf("%d", &n);
		for (i = 0;i < n;i++) {
			scanf("%d %d", &s, &f);
			z += f - s;
		}
		if (z >= t) {
			printf("OK\n");
		}
		else {
			printf("%d\n",t - z);
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    4 |         scanf_s("%d", &t);
      |         ^~~~~~~
      |         scanf
Language: C

#include<stdio.h>

int main(void)
{
	int a, b, d, e, f = 0, i;
	while (scanf("%d", &a))
	{
		if (a == 0)break;
		scanf("%d", &b);
		for (i = 0;i < b;i++)
		{
			scanf_s("%d %d", &d, &e);
			f = f + (e - d);
		}
		if(f > a)
		{
			printf("OK\n");
		}
		else
		{
			f = a - f;
			printf("%d\n", f);
		}
		f = 0;
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:25: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   12 |                         scanf_s("%d %d", &d, &e);
      |                         ^~~~~~~
      |                         scanf
Language: C

#include<stdio.h>
int main(void) 
{
	int t, n, s, f,a,b,c=0,d;
	scanf("%d", &t);
	scanf("%d", &n);
	for (a = 1;a <= n;a++)
	{
		scanf("%d %d", &s, &f);
		b = f - s;
		c = c + b;
	}
	d = t - c;
	if (d > 0)
	{
		printf("%d??????????¶?\n",d);
	}
	else
	{
		printf("OK!!\n");
	}
return 0;

Compiler output:
main.c: In function 'main':
main.c:22:1: error: expected declaration or statement at end of input
   22 | return 0;
      | ^~~~~~
Language: C

#include<stdio.h>
int main(void)
{
	int t, n, s, f, a, b, c = 0, d;
	while (1)
	{
		scanf("%d", &t);
		if (t != 0)
		{
			break;
		}
		scanf("%d", &n);
		for (a = 1;a <= n;a++)
		{
			scanf("%d %d", &s, &f);
			b = f - s;
			c = c + b;
		}
		d = t - c;
		if (d > 0)
		{
			printf("%d\n", d);
		}

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

#include <stdio.h>

int main(void)
{
	int benkyou;
	int kaisuu;
	int benkyou_s;
	int benkyou_e;
	int sum;
	int i;
	
	while (1){
		scanf("%d", &benkyou);
		
		if (benkyou == 0){
			break;
		}
		
		scanf("%d", &kaisuu);
		
		sum = 0;
		
		for (i = 0; i < kaisuu; i++){
			scanf("%d%d", &benkyou_s, &benkyou_e);
			sum += benkyou_e - benkyou_s;
		}
		
		if (benkyou - sum <= 0){
			printf("OK\n");
		}
		
		else {
			printf("%d
\n", benkyou - sum);
		}
	}
	
	return (0);
}

Compiler output:
main.c: In function 'main':
main.c:33:32: warning: missing terminating " character
   33 |                         printf("%d
      |                                ^
main.c:33:32: error: missing terminating " character
   33 |                         printf("%d
      |                                ^~~
main.c:34:1: error: stray '\' in program
   34 | \n", benkyou - sum);
      | ^
main.c:34:3: warning: missing terminating " character
   34 | \n", benkyou - sum);
      |   ^
main.c:34:3: error: missing terminating " character
   34 | \n", benkyou - sum);
      |   ^~~~~~~~~~~~~~~~~~
main.c:34:2: error: 'n' undeclared (first use in this function)
   34 | \n", benkyou - sum);
      |  ^
main.c:34:2: note: each undeclared identifier is reported only once for each function it appears in
main.c:34:3: error: expected ')' before '}' token
   34 | \n", benkyou - sum);
      |   ^
      |   )
   35 |                 }
      |                 ~
main.c:33:31: note: to match this '('
   33 |                         printf("%d
      |                               ^
main.c:34:3: error: expected ';' before '}' token
   34 | \n", benkyou - sum);
      |   ^
      |   ;
   35 |                 }
      |                 ~
Language: C

#include <stdio.h>

int main(void) {
	int target;
	int num,i;
	int start,end;
	while(1) {
		scanf("%d",&target);
		if(target==0)break;
		scanf("%d",&num);
		for(i=0;i<num;i++) {
			scanf("%d%d",&start,&end);
			target-=end-start;
		}
		if(target<=0)puts("OK"); else printf("%d\n",target);
	}
	return 0;

Compiler output:
main.c: In function 'main':
main.c:17:9: error: expected declaration or statement at end of input
   17 |         return 0;
      |         ^~~~~~
Language: C

t,n,s;main(f){for(;scanf("%d%d",&t,&n)/2;printf(t>0?"%d\n":"OK\n",t))for(;n--;t-=f-s)scanf("%d%d",&s,&f);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | t,n,s;main(f){for(;scanf("%d%d",&t,&n)/2;printf(t>0?"%d\n":"OK\n",t))for(;n--;t-=f-s)scanf("%d%d",&s,&f);}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
    1 | t,n,s;main(f){for(;scanf("%d%d",&t,&n)/2;printf(t>0?"%d\n":"OK\n",t))for(;n--;t-=f-s)scanf("%d%d",&s,&f);}
      |   ^
main.c:1:5: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
    1 | t,n,s;main(f){for(;scanf("%d%d",&t,&n)/2;printf(t>0?"%d\n":"OK\n",t))for(;n--;t-=f-s)scanf("%d%d",&s,&f);}
      |     ^
main.c:1:7: error: return type defaults to 'int' [-Wimplicit-int]
    1 | t,n,s;main(f){for(;scanf("%d%d",&t,&n)/2;printf(t>0?"%d\n":"OK\n",t))for(;n--;t-=f-s)scanf("%d%d",&s,&f);}
      |       ^~~~
main.c: In function 'main':
main.c:1:7: error: type of 'f' defaults to 'int' [-Wimplicit-int]
main.c:1:20: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | t,n,s;main(f){for(;scanf("%d%d",&t,&n)/2;printf(t>0?"%d\n":"OK\n",t))for(;n--;t-=f-s)scanf("%d%d",&s,&f);}
      |                    ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | t,n,s;main(f){for(;scanf("%d%d",&t,&n)/2;printf(t>0?"%d\n":"OK\n",t))for(;n--;t-=f-s)scanf("%d%d",&s,&f);}
main.c:1:20: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | t,n,s;main(f){for(;scanf("%d%d",&t,&n)/2;printf(t>0?"%d\n":"OK\n",t))for(;n--;t-=f-s)scanf("%d%d",&s,&f);}
      |                    ^~~~~
main.c:1:20: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:42: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | t,n,s;main(f){for(;scanf("%d%d",&t,&n)/2;printf(t>0?"%d\n":"OK\n",t))for(;n--;t-=f-s)scanf("%d%d",&s,&f);}
      |                                          ^~~~~~
main.c:1:42: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:42: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:42: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
t,n,s;main(f){for(;scanf("%d%d",&t,&n)/2;printf(t>0?"%d\n":"OK\n",t))for(;n--;t-=f-s)scanf("%d%d",&s,&f);}

Compiler output:
main.c:2:1: warning: data definition has no type or storage class
    2 | t,n,s;main(f){for(;scanf("%d%d",&t,&n)/2;printf(t>0?"%d\n":"OK\n",t))for(;n--;t-=f-s)scanf("%d%d",&s,&f);}
      | ^
main.c:2:1: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
main.c:2:3: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
    2 | t,n,s;main(f){for(;scanf("%d%d",&t,&n)/2;printf(t>0?"%d\n":"OK\n",t))for(;n--;t-=f-s)scanf("%d%d",&s,&f);}
      |   ^
main.c:2:5: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
    2 | t,n,s;main(f){for(;scanf("%d%d",&t,&n)/2;printf(t>0?"%d\n":"OK\n",t))for(;n--;t-=f-s)scanf("%d%d",&s,&f);}
      |     ^
main.c:2:7: error: return type defaults to 'int' [-Wimplicit-int]
    2 | t,n,s;main(f){for(;scanf("%d%d",&t,&n)/2;printf(t>0?"%d\n":"OK\n",t))for(;n--;t-=f-s)scanf("%d%d",&s,&f);}
      |       ^~~~
main.c: In function 'main':
main.c:2:7: error: type of 'f' defaults to 'int' [-Wimplicit-int]
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <map> 
using namespace std;
 
const int MAX= 10000100;
 
int main(void){
  int t,n;
  while(cin>>t,t){
    int ans = 0;
    cin>>n;
    for(int i = 0 ; i < n ; i ++){
      int s,e;
      cin>>s>>e;
      ans+=e-s;
    }
    cout<<(ans>t?"OK":t-ans)<<endl;
   }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: operands to '?:' have different types 'const char*' and 'int'
   22 |     cout<<(ans>t?"OK":t-ans)<<endl;
      |            ~~~~~^~~~~~~~~~~
Language: C++

#include<stdio.h>

int main(){

int G,N;
while(1){
scanf("%d",&G);if(G==0)break;

scanf("%d",&N);
int s,f;
for(int i=0;i<N;i++)
{
scanf("%d %d",&s,&f)
f-=s;
G-=f;
if(G<=0)break;
}
if(G<=0)printf("OK\n");
else printf("%d\n",G);
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:21: error: expected ';' before 'f'
   13 | scanf("%d %d",&s,&f)
      |                     ^
      |                     ;
   14 | f-=s;
      | ~
Language: C++

#include <stdio.h>

int main(void){
	int t,n,s,f;
	
	for (scanf("%d", &t), t){
		scanf("%d", &n);
		for (; n>=0; n--){
			scanf("%d %d", &s, &f);
			t -= (f-s);
		}
		if (t<0) puts("OK");
		else printf("%d\n", t);
	}
	return 0;
}
	
	

Compiler output:
a.cc: In function 'int main()':
a.cc:6:32: error: expected ';' before ')' token
    6 |         for (scanf("%d", &t), t){
      |                                ^
      |                                ;
a.cc:15:9: error: expected primary-expression before 'return'
   15 |         return 0;
      |         ^~~~~~
a.cc:14:10: error: expected ';' before 'return'
   14 |         }
      |          ^
      |          ;
   15 |         return 0;
      |         ~~~~~~
a.cc:15:9: error: expected primary-expression before 'return'
   15 |         return 0;
      |         ^~~~~~
a.cc:14:10: error: expected ')' before 'return'
   14 |         }
      |          ^
      |          )
   15 |         return 0;
      |         ~~~~~~
a.cc:6:13: note: to match this '('
    6 |         for (scanf("%d", &t), t){
      |             ^
Language: C++

#include <bits/stdc++.h>
#define FOR(v, a, b) for(int v = (a); v < (b); ++v)
#define REP(v, n) FOR(v, 0, n);
using namespace std;

int main(){
	int t, n, s, f, sum;
	
	while(cin >> t, t){
		cin >> n;
		sum = 0;
		REP(i, n){
			cin >> s >> f;
			sum += (f - s);
		}
		if(sum >= t) cout << "OK" << endl;
		else cout << t - sum << endl;
	
	return 0;
}

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

?°??\???§??????

Compiler output:
a.cc:1:2: error: extended character ° is not valid in an identifier
    1 | ?°??\???§??????
      |  ^
a.cc:1:5: error: stray '\' in program
    1 | ?°??\???§??????
      |     ^
a.cc:1:9: error: extended character § is not valid in an identifier
    1 | ?°??\???§??????
      |         ^
a.cc:1:1: error: expected unqualified-id before '?' token
    1 | ?°??\???§??????
      | ^
Language: C++

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

 
class Program
{
    static void Main(string[] args)
    {
        while(true){
            int t,n;
            t=int.Parse(Console.ReadLine());
            n=int.Parse(Console.ReadLine());
            int sum=0;
            for(int i=0;i<n;++i){
                int s,f;		
                string[] input = Console.ReadLine().Split(' ');
                s=int.Parse(input[0]);
                f=int.Parse(input[1]);
                sum+=f-s;
            }
            if(sum>=t){
                Console.WriteLine("OK");
            }else{
                Console.WriteLine(t-sum);
            }
        }
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Text;
      |       ^~~~~~
a.cc:9:22: error: 'string' has not been declared
    9 |     static void Main(string[] args)
      |                      ^~~~~~
a.cc:9:31: error: expected ',' or '...' before 'args'
    9 |     static void Main(string[] args)
      |                               ^~~~
a.cc:30:2: error: expected ';' after class definition
   30 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main(int*)':
a.cc:13:15: error: expected primary-expression before 'int'
   13 |             t=int.Parse(Console.ReadLine());
      |               ^~~
a.cc:14:15: error: expected primary-expression before 'int'
   14 |             n=int.Parse(Console.ReadLine());
      |               ^~~
a.cc:18:17: error: 'string' was not declared in this scope
   18 |                 string[] input = Console.ReadLine().Split(' ');
      |                 ^~~~~~
a.cc:18:24: error: expected primary-expression before ']' token
   18 |                 string[] input = Console.ReadLine().Split(' ');
      |                        ^
a.cc:19:19: error: expected primary-expression before 'int'
   19 |                 s=int.Parse(input[0]);
      |                   ^~~
a.cc:20:19: error: expected primary-expression before 'int'
   20 |                 f=int.Parse(input[1]);
      |                   ^~~
a.cc:24:17: error: 'Console' was not declared in this scope
   24 |                 Console.WriteLine("OK");
      |                 ^~~~~~~
a.cc:26:17: error: 'Console' was not declared in this scope
   26 |                 Console.WriteLine(t-sum);
      |                 ^~~~~~~
Language: C++

using System;

class Program
{
    static void Main(string[] args)
    {
        while(true){
            int t=int.Parse(Console.ReadLine());
            int n=int.Parse(Console.ReadLine());
            int sum=0;
            for(int i=0;i<n;++i){
               	
                string[] input = Console.ReadLine().Split(' ');
                int s=int.Parse(input[0]);
                int f=int.Parse(input[1]);
                sum+=f-s;
            }
            if(sum>=t){
                Console.WriteLine("OK");
            }else{
                Console.WriteLine(t-sum);
            }
        }
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:5:22: error: 'string' has not been declared
    5 |     static void Main(string[] args)
      |                      ^~~~~~
a.cc:5:31: error: expected ',' or '...' before 'args'
    5 |     static void Main(string[] args)
      |                               ^~~~
a.cc:25:2: error: expected ';' after class definition
   25 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main(int*)':
a.cc:8:19: error: expected primary-expression before 'int'
    8 |             int t=int.Parse(Console.ReadLine());
      |                   ^~~
a.cc:9:19: error: expected primary-expression before 'int'
    9 |             int n=int.Parse(Console.ReadLine());
      |                   ^~~
a.cc:13:17: error: 'string' was not declared in this scope
   13 |                 string[] input = Console.ReadLine().Split(' ');
      |                 ^~~~~~
a.cc:13:24: error: expected primary-expression before ']' token
   13 |                 string[] input = Console.ReadLine().Split(' ');
      |                        ^
a.cc:14:23: error: expected primary-expression before 'int'
   14 |                 int s=int.Parse(input[0]);
      |                       ^~~
a.cc:15:23: error: expected primary-expression before 'int'
   15 |                 int f=int.Parse(input[1]);
      |                       ^~~
a.cc:19:17: error: 'Console' was not declared in this scope
   19 |                 Console.WriteLine("OK");
      |                 ^~~~~~~
a.cc:21:17: error: 'Console' was not declared in this scope
   21 |                 Console.WriteLine(t-sum);
      |                 ^~~~~~~
Language: C++

using System;

namespace a{
    class Program
{
    static void Main(string[] args)
    {
        while(true){
            int t=int.Parse(Console.ReadLine());
            int n=int.Parse(Console.ReadLine());
            int sum=0;
            for(int i=0;i<n;++i){
               	
                string[] input = Console.ReadLine().Split(' ');
                int s=int.Parse(input[0]);
                int f=int.Parse(input[1]);
                sum+=f-s;
            }
            if(sum>=t){
                Console.WriteLine("OK");
            }else{
                Console.WriteLine(t-sum);
            }
        }
    }
}
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:6:22: error: 'string' has not been declared
    6 |     static void Main(string[] args)
      |                      ^~~~~~
a.cc:6:31: error: expected ',' or '...' before 'args'
    6 |     static void Main(string[] args)
      |                               ^~~~
a.cc:26:2: error: expected ';' after class definition
   26 | }
      |  ^
      |  ;
a.cc: In static member function 'static void a::Program::Main(int*)':
a.cc:9:19: error: expected primary-expression before 'int'
    9 |             int t=int.Parse(Console.ReadLine());
      |                   ^~~
a.cc:10:19: error: expected primary-expression before 'int'
   10 |             int n=int.Parse(Console.ReadLine());
      |                   ^~~
a.cc:14:17: error: 'string' was not declared in this scope
   14 |                 string[] input = Console.ReadLine().Split(' ');
      |                 ^~~~~~
a.cc:14:24: error: expected primary-expression before ']' token
   14 |                 string[] input = Console.ReadLine().Split(' ');
      |                        ^
a.cc:15:23: error: expected primary-expression before 'int'
   15 |                 int s=int.Parse(input[0]);
      |                       ^~~
a.cc:16:23: error: expected primary-expression before 'int'
   16 |                 int f=int.Parse(input[1]);
      |                       ^~~
a.cc:20:17: error: 'Console' was not declared in this scope
   20 |                 Console.WriteLine("OK");
      |                 ^~~~~~~
a.cc:22:17: error: 'Console' was not declared in this scope
   22 |                 Console.WriteLine(t-sum);
      |                 ^~~~~~~
Language: C++

#include<stdio.h>
int main(void)
{
	int n,t,i,k,h,x,w;
	w=0;
	while(1){
	scanf("%d",&n);
	if(n==0) break;
	scanf("%d",&t);
	for(i=0;i<t;i++){
		scanf("%d %d",&k,&h);
		w+=h-k;
		}
	if(n=<w){
		printf("OK\n");
		}
	else{
		x=n-w;
		printf("%d\n",x);
		}
	w=0;	
	}
		return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: expected primary-expression before '<' token
   14 |         if(n=<w){
      |              ^
Language: C++

#include <iostream>
using namespace std;
int main(){
	int t,n,s,f;
	cin>>t>>n>>s>>f;
	for(int i=0;i<n;i++){
		if(f[i]-s[i]>=t)
			cout<<"OK"<<endl;
		else{	A=f[i]-s[i];
			cout<<t-A<<endl;
}
}
return 0;
}
		

Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: invalid types 'int[int]' for array subscript
    7 |                 if(f[i]-s[i]>=t)
      |                     ^
a.cc:7:26: error: invalid types 'int[int]' for array subscript
    7 |                 if(f[i]-s[i]>=t)
      |                          ^
a.cc:9:25: error: 'A' was not declared in this scope
    9 |                 else{   A=f[i]-s[i];
      |                         ^
a.cc:9:28: error: invalid types 'int[int]' for array subscript
    9 |                 else{   A=f[i]-s[i];
      |                            ^
a.cc:9:33: error: invalid types 'int[int]' for array subscript
    9 |                 else{   A=f[i]-s[i];
      |                                 ^
Language: C++

#include <iostream>
using namespace std;
int main(){
	int t,n,s,f;
	cin>>t;
	if(t==0)
	break;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>s>>f;
		t-=f-s;
}
	if(t>0)
	cout<<m<<endl;
	else
	cout<<"OK"<<endl;
	
return 0;
}
		

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: break statement not within loop or switch
    7 |         break;
      |         ^~~~~
a.cc:14:15: error: 'm' was not declared in this scope
   14 |         cout<<m<<endl;
      |               ^
Language: C++

#include <iostream>
using namespace std;
int main(){
	int t,n,s,f;
	while(true){
	cin>>t;
	if(t==0)
	break;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>s>>f;
		t-=f-s;
}
	if(t>0)
	cout<<m<<endl;
	else
	cout<<"OK"<<endl;
	
return 0;
}
}		

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

#include<stdio.h>
int main(void)
{
    int t,n,i,s,f;
	scanf("%d %d",&t,&n);
	for(i=0;i<n;i++){
	    scanf("%d %d",&s,&f);
		t=t-(f-s);
	}
	if(t<=0){
	    printf("OK\n");
	}
	else printf("%d\n",t);
	}
}

Compiler output:
a.cc:15:1: error: expected declaration before '}' token
   15 | }
      | ^
Language: C++

#include<stdio.h>
int main(void)
{
    int t,n,i,s,f;
	scanf("%d %d",&t,&n);
	while (1){
	    if (n=0) break;
		for(i=0;i<n;i++){
			scanf("%d %d",&s,&f);
			t=t-(f-s);
		}
		if(t<=0){
			printf("OK\n");
		}
		else printf("%d\n",t);
		}
		return 0;
	}
}

Compiler output:
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  while(true){
    int t;cin>>t;
    if(t == 0)return 0;

    int n; cin >> n;
    int result= 0;
    for(int i = 0; i < n; i++){
      int time[2] = {};
      cin >>time[0] >> time[1];
      result += time[1]-time[0];
    }
    (result > t)?(cout << "OK"<<endl):(cout<<t-result<<endl);
  return 0;
}

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

#include <iostream>
using namespace std;
int main (void)
{
	while(true)
	{
		int n, m, p;
		p = 0;
		cin >> n;
		if(n == 0) 
		{
			break;
		}
		cin >> m;
		while(m > 0)
		{
			int s, q;
			cin >> s >>q;
			p += q-s;
			m--;
		}
		if(p >= n)
		{
			cout << "OK"<< endl;
		}
		else
		{
			cout << n - p;
		}
	}
	return 0;
}
			int s, q;
			cin >> s >>q;
			p += q-s;
			m--;
		}
		if(p >= n)
		{
			cout << "OK"<< endl;
		}
		else
		{
			cout << n - p;
		}
	}
	return 0;
}

Compiler output:
a.cc:34:25: error: 'cin' does not name a type
   34 |                         cin >> s >>q;
      |                         ^~~
a.cc:35:25: error: 'p' does not name a type
   35 |                         p += q-s;
      |                         ^
a.cc:36:25: error: 'm' does not name a type; did you mean 'tm'?
   36 |                         m--;
      |                         ^
      |                         tm
a.cc:37:17: error: expected declaration before '}' token
   37 |                 }
      |                 ^
a.cc:38:17: error: expected unqualified-id before 'if'
   38 |                 if(p >= n)
      |                 ^~
a.cc:42:17: error: expected unqualified-id before 'else'
   42 |                 else
      |                 ^~~~
a.cc:46:9: error: expected declaration before '}' token
   46 |         }
      |         ^
a.cc:47:9: error: expected unqualified-id before 'return'
   47 |         return 0;
      |         ^~~~~~
a.cc:48:1: error: expected declaration before '}' token
   48 | }
      | ^
Language: C++

#include<iostream>

using namespace std;

int main(){
  int t,n,s,f,cnt;
  while(true){
    cin>> t;
    if(t==0)break;
    cn >> n;
    for(int i=0;i<n;i++){
      cin >> s >> f;
      cnt+= f-s;
    }
    if(cnt >= t)cout<< "OK" << endl;
    else cout << t-fe << endl;

  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'cn' was not declared in this scope; did you mean 'cnt'?
   10 |     cn >> n;
      |     ^~
      |     cnt
a.cc:16:20: error: 'fe' was not declared in this scope; did you mean 'f'?
   16 |     else cout << t-fe << endl;
      |                    ^~
      |                    f
Language: C++

include<iostream>
using namespace std;

int main(){
  int t,n,s,f,cnt;
  while(true){
    cin>> t;
    cnt = 0;
    if(t==0)break;
    cin >> n;
    for(int i=0;i<n;i++){
      cin >> s >> f;
      cnt+= f-s;
    }
    if(cnt >= t)cout<< "OK" << endl;
    else cout << t-cnt << endl;

  }
  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin>> t;
      |     ^~~
a.cc:15:17: error: 'cout' was not declared in this scope
   15 |     if(cnt >= t)cout<< "OK" << endl;
      |                 ^~~~
a.cc:15:32: error: 'endl' was not declared in this scope
   15 |     if(cnt >= t)cout<< "OK" << endl;
      |                                ^~~~
a.cc:16:10: error: 'cout' was not declared in this scope
   16 |     else cout << t-cnt << endl;
      |          ^~~~
a.cc:16:27: error: 'endl' was not declared in this scope
   16 |     else cout << t-cnt << endl;
      |                           ^~~~
Language: C++

include <iostream>
using namespace std;
int d, n, s, t, sum;
int main() {
  
  while(cin>>d>>n, d) {
    for(int i=0; i<n; i++) {
      cin >> s >> t;
      sum += t-s;
    }
    if(sum<d) cout << sum-d << endl;
    else cout << "OK" << endl;
  }
  
  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |   while(cin>>d>>n, d) {
      |         ^~~
a.cc:11:15: error: 'cout' was not declared in this scope
   11 |     if(sum<d) cout << sum-d << endl;
      |               ^~~~
a.cc:11:32: error: 'endl' was not declared in this scope
   11 |     if(sum<d) cout << sum-d << endl;
      |                                ^~~~
a.cc:12:10: error: 'cout' was not declared in this scope
   12 |     else cout << "OK" << endl;
      |          ^~~~
a.cc:12:26: error: 'endl' was not declared in this scope
   12 |     else cout << "OK" << endl;
      |                          ^~~~
Language: C++

#include <iostream>
using namespace std;
int main (){
       int a;
       while(cin>>a){
            if(a==0)break;
            int N;
            cin>>n;
            int ans=0;
            for(int i=0;i<N;i++){
                      int c,d;
                      cin>>c>>d;
                       ans+=d-c;
               }
                       if(ans>a){
                              cout<<"OK"<<endl;
                        }
                        else{   cout<<"NO"<<endl;
                      }   
                }
         return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: 'n' was not declared in this scope
    8 |             cin>>n;
      |                  ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	int sum;
	int a,b;
	int m,n;
	while(cin>>m,m!=0){
		cin>>n;
		sum=0;
		for(int i=0;i<n;i++){
			cin>>a>>b;
			sum+=b-a;
		}
		if(m<sum)cout<<"OK"<<endl;A
		else cout<<m-sum<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:43: error: 'A' was not declared in this scope
   15 |                 if(m<sum)cout<<"OK"<<endl;A
      |                                           ^
Language: Java

import java.util.*;
 
public class Program2{
 
    void run(){
        Scanner sc = new Scanner(System.in);
        for(;;){
            int n = sc.nextInt();
            if(n==0)break;
            int[] id = new int[n], p = new int[n], q = new int[n], r = new int[n];
            for(int i=0;i<n;i++){
                id[i] = sc.nextInt();
                p[i] = sc.nextInt();
                q[i] = sc.nextInt();
                r[i] = sc.nextInt();
            }
            List<Integer> l = new ArrayList<Integer>();
            int P = sc.nextInt(), Q = sc.nextInt(), R = sc.nextInt(), C = sc.nextInt();
            for(int i=0;i<n;i++){
                if(p[i]<=P && q[i]<=Q && r[i]<=R && p[i]*4+q[i]*9+r[i]*4<=C)l.add(id[i]);
            }
            if(l.isEmpty())System.out.println("NA");
            else for(int x:l)System.out.println(x);
        }
    }
     
    public static void main(String[] args) {
        new Program2().run();
    }
}

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

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
 
//Calorie Counting
public class Program2{
 
    void run(){
        Scanner sc = new Scanner(System.in);
        for(;;){
            int n = sc.nextInt();
            if(n==0)break;
            int[] id = new int[n], p = new int[n], q = new int[n], r = new int[n];
            for(int i=0;i<n;i++){
                id[i] = sc.nextInt();
                p[i] = sc.nextInt();
                q[i] = sc.nextInt();
                r[i] = sc.nextInt();
            }
            List<Integer> l = new ArrayList<Integer>();
            int P = sc.nextInt(), Q = sc.nextInt(), R = sc.nextInt(), C = sc.nextInt();
            for(int i=0;i<n;i++){
                if(p[i]<=P && q[i]<=Q && r[i]<=R && p[i]*4+q[i]*9+r[i]*4<=C)l.add(id[i]);
            }
            if(l.isEmpty())System.out.println("NA");
            else for(int x:l)System.out.println(x);
        }
    }
     
    public static void main(String[] args) {
        new Program2().run();
    }
}

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

import java.util.Scanner;
public class Main_0239{
        public static void main(String[] args){
	         Scanner sc = new Scanner(System.in);
	         int n,i,P,Q,R,C,han;
	         int[] p = new int[1000];
	         int[] q = new int[1000];
	         int[] r = new int[1000];
	         int[] kei = new int[1000];
	         int[] hoz = new int[1000];
		n = sc.nextInt();
		while(n!=0){
			for(int j=0; j<n; j++){
				i = sc.nextInt();
				p[j] = sc.nextInt();
				q[j] = sc.nextInt();
				r[j] = sc.nextInt();
				kei[j] = ((p[j]*4)+(q[j]*9)+(r[j]*4));
				hoz[j] = i;
			}
			P = sc.nextInt();
			Q = sc.nextInt();
			R = sc.nextInt();
			C = sc.nextInt();
			han = 0;
			for(int j=0; j<n; j++){
				if(p[j]>P || q[j]>Q || r[j]>R || kei[j]>C){
				}else{
					han+=1;
					System.out.println(hoz[j]);
				}
			}
			if(han==0){
				System.out.println("NA");
			}
			n = sc.nextInt();
		}
	}
}

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

#include <stdio.h>
  int main(){
    int n,j,i;
    int x[1001][4];
    int p,q,r,c;
    scanf("%d",&n);
    for(j=0;j<n;j++){
      scanf("%d %d %d %d",&i,&x[j+1][1],&x[j+1][2],&x[j+1][3]);
x[j+1][0]=x[j+1][1]*4 + x[j+1][2]*9 + [j+1][3]*4;
}
printf("%d %d %d %d",&p,&q,&r,&c);
for(j=0;j<n;j++){
int sum;
  if(x[j+1][1]<=p && x[j+1][2]<=q && x[j+1][3]<=r && x[j+1][0]<=c){
printf("%d\n",j+1);
}else{
sum++;
}
if(sum==n){
printf("NA");
printf("\n");
}
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:39: error: expected expression before '[' token
    9 | x[j+1][0]=x[j+1][1]*4 + x[j+1][2]*9 + [j+1][3]*4;
      |                                       ^
Language: C++

include <iostream>
using namespace std;

int main(){
  
  int n;
  while(cin >> n, n){
    int id[1001], p[1001], q[1001], r[1001];
    int P, Q, R, C;
    for(int i = 0; i < n; i++) cin >> id[i] >> p[i] >> q[i] >> r[i];
    cin >> P >> Q >> R >> C;
    
    bool judge = true;
    for(int i = 0; i < n; i++){
      if(p[i] <= P && q[i] <= Q && r[i] <= R && p[i]*4 + q[i]*9 + r[i]*4 <= C){
	cout << id[i] << endl;
	judge = false;
      }
    }
    if(judge) cout << "NA" << endl;
  }
  
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |   while(cin >> n, n){
      |         ^~~
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout << id[i] << endl;
      |         ^~~~
a.cc:16:26: error: 'endl' was not declared in this scope
   16 |         cout << id[i] << endl;
      |                          ^~~~
a.cc:20:15: error: 'cout' was not declared in this scope
   20 |     if(judge) cout << "NA" << endl;
      |               ^~~~
a.cc:20:31: error: 'endl' was not declared in this scope
   20 |     if(judge) cout << "NA" << endl;
      |                               ^~~~
Language: C++

include <iostream>

using namespace std;

int main() {
	for (;;) {
		int n;
		cin >> n;

		if (n == 0)
			return 0;

		int p[n], q[n], r[n], c[n];
		for (int x = 0; x < n; x++) {
			int _;
			cin >> _ >> p[x] >> q[x] >> r[x];
			c[x] = p[x] * 4 + q[x] * 9 + r[x] * 4;
		}

		int P, Q, R, C;
		cin >> P >> Q >> R >> C;

		bool output;
		for (int x = 0; x < n; x++) {
			if (p[x] <= P && q[x] <= Q && r[x] <= R && c[x] <= C) {
				cout << x + 1 << endl;
				output = true;
			}
		}

		if (!output)
			cout << "NA" << endl;
	}

	return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:17: error: 'cin' was not declared in this scope
    8 |                 cin >> n;
      |                 ^~~
a.cc:26:33: error: 'cout' was not declared in this scope
   26 |                                 cout << x + 1 << endl;
      |                                 ^~~~
a.cc:26:50: error: 'endl' was not declared in this scope
   26 |                                 cout << x + 1 << endl;
      |                                                  ^~~~
a.cc:32:25: error: 'cout' was not declared in this scope
   32 |                         cout << "NA" << endl;
      |                         ^~~~
a.cc:32:41: error: 'endl' was not declared in this scope
   32 |                         cout << "NA" << endl;
      |                                         ^~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
	int x[1000],n,i,p[100],q[100],r[100],c[1700],P,Q,R,C,w;
	 while(cin>>n){
	  if(n==0){ // nに0個になると停止
           return 0;
           }
           
        for(i=0;i<n;i++){ //n個の箱を用意する 
	    cin>>x[i]>>p[i]>>q[i]>>r[i]; //お菓子の情報入力
	    c[i]=p[i]*4+q[i]*9+r[i]*4; 	  
	}
	
	cin>>P>>Q>>R>>C;
	P*=4;
	Q*=9;
	R*=4;
	C=P+Q+R;
	
	for(i=0;i<n;i++){
	    if(P>=p[i]*4&&Q>=q[i]*9&&R>=r[i]*4&&C>=c[i]){
		    cout<<x[i]<<endl;   
             }
             }
             if(x[i]==3){
              cout<<"NA"<<endl;
            }
	       
	 }
     }
     return 0;
}

Compiler output:
a.cc:33:6: error: expected unqualified-id before 'return'
   33 |      return 0;
      |      ^~~~~~
a.cc:34:1: error: expected declaration before '}' token
   34 | }
      | ^
Language: C++

#include<stdio.h>
int main(void)
{
	int a,s[10001],d[10001],f[10001],g[10001];
	int	h,j,k,z,i,flg;
	scanf("%d",&a);
	while(a!=0){
	flg=0;
		for(i=1;i<=a;i++){
			scanf("%d %d %d %d",&s[i],&d[i],&f[i],&g[i]);
		}
		scanf("%d %d %d %d",&h,&j,&k,&z);
		for(i=1;i<=a;i++){
			if(h>d[i]&&j>f[i]&&k>g[i]&&z>d[i]+f[i]+g[i]){
				printf("%d\n",s[i]);
				flg=1;
			}
		}
		else if(flg==0){
			printf("NA\n");
		}
		scanf("%d",&a);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'else' without a previous 'if'
   19 |                 else if(flg==0){
      |                 ^~~~
Language: C++

#include<stdio.h>
int main(void)
{
	int n,j,i[1000],p[100],q[100],r[100],p2,q2,r2,c,flg,x[1000];
	while(1){
		cnt=0;
		flg=0;
		scanf("%d",&n);
		if(n==0)break;
		for(j=0;j<n;j++){
			scanf("%d %d %d %d",&i[j],&p[j],&q[j],&r[j]);
		}
		scanf("%d %d %d %d",&p2,&q2,&r2,&c);
		for(j=0;j<n;j++){
			if(p[j]<=p2&&q[j]<=q2&&r[j]<=r2&&p[j]*4+q[j]+r[j]*4<=c){
				x[cnt]=i[j];
				cnt++;
				flg=1;
				break;
			}
		}
		if(flg==1){
			for(j=0;j<cnt;j++){
				printf("%d\n",x[j]);
			}
		}
		else{
			printf("NA\n");
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
    6 |                 cnt=0;
      |                 ^~~
      |                 int
Language: C++

#include<stdio.h>
int main(void)
{
	int n,i,a[1000],s[1000],d[1000],f[10000],g,h,j,k,w[1000],flg;
	while(1){
	scanf("%d",&n);
	if(n==0) break;
	for(i=0;i<n;i++){
	scanf("%d %d %d %d",&a[i],&s[i],&d[i],&f[i]);
	w[i]=4*s[i]+9*d[i]+4*f[i];
	}
	scanf("%d %d %d %d",&g,&h,&j,&k);
		flg=0;
	for(i=0;i<n;i++){
	if(g=>s[i]&&h=>d[i]&&j=>f[i]&&k=>w[i]){
		printf("%d\n",a[i]);
		flg=1;
		}
	}
	if(flg=0){
		printf("NA\n");
		}
	}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: expected primary-expression before '>' token
   15 |         if(g=>s[i]&&h=>d[i]&&j=>f[i]&&k=>w[i]){
      |              ^
a.cc:15:23: error: expected primary-expression before '>' token
   15 |         if(g=>s[i]&&h=>d[i]&&j=>f[i]&&k=>w[i]){
      |                       ^
a.cc:15:32: error: expected primary-expression before '>' token
   15 |         if(g=>s[i]&&h=>d[i]&&j=>f[i]&&k=>w[i]){
      |                                ^
a.cc:15:41: error: expected primary-expression before '>' token
   15 |         if(g=>s[i]&&h=>d[i]&&j=>f[i]&&k=>w[i]){
      |                                         ^
Language: C++

#include<stdio.h>
int main(void)
{
	int n,i,a[1000],s[1000],d[1000],f[10000],g,h,j,k,w[1000],flg;
	while(1){
	scanf("%d",&n);
	if(n==0) break;
	for(i=0;i<n;i++){
	scanf("%d %d %d %d",&a[i],&s[i],&d[i],&f[i]);
	w[i]=4*s[i]+9*d[i]+4*f[i];
	}
	scanf("%d %d %d %d",&g,&h,&j,&k);
		flg=0;
	for(i=0;i<n;i++){
	if(g=>s[i]&&h=>d[i]&&j=>f[i]&&k=>w[i]){
		printf("%d\n",a[i]);
		flg=1;
		}
	}
	if(flg==0){
		printf("NA\n");
		}
	}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: expected primary-expression before '>' token
   15 |         if(g=>s[i]&&h=>d[i]&&j=>f[i]&&k=>w[i]){
      |              ^
a.cc:15:23: error: expected primary-expression before '>' token
   15 |         if(g=>s[i]&&h=>d[i]&&j=>f[i]&&k=>w[i]){
      |                       ^
a.cc:15:32: error: expected primary-expression before '>' token
   15 |         if(g=>s[i]&&h=>d[i]&&j=>f[i]&&k=>w[i]){
      |                                ^
a.cc:15:41: error: expected primary-expression before '>' token
   15 |         if(g=>s[i]&&h=>d[i]&&j=>f[i]&&k=>w[i]){
      |                                         ^
Language: C++

#include<stdio.h>
int main(main)
{
    int n,a,i[1010];
    int p[1010],q[1010],r[1010],c[1010];
	int pc[1010],qc[1010],rc[1010],cc[1010];
	int f;
	while (scanf("%d",&n),n!=0){
	    for (a=0;a<n;a++){
		    scanf("%d %d %d %d",&i[a],&p[a],&q[a],&r[a]);
			c[a]=4*p[a]+9*q[a]+4*r[a];
		}
		scanf("%d %d %d %d",&pc,&qc,&rc,&cc);
		f=0;
		for (a=0;a<n;a++){
		    if (pc[a]>=p[a]&&qc[a]>=q[a]&&rc[a]>=r[a]&&cc[a]>=c[a]){
			    printf("%d\n",i[a]);
			f=1;
			}
		}
		if (f==0){
		    printf("NA\n");
		}
	}
	return 0;
}

Compiler output:
a.cc:2:5: error: cannot declare '::main' to be a global variable
    2 | int main(main)
      |     ^~~~
a.cc:3:1: error: expected ',' or ';' before '{' token
    3 | {
      | ^
Language: C++

#include<stdio.h>
int main(main)
{
    int n,a,i[1010];
    int p[1010],q[1010],r[1010],c[1010];
	int pc,qc,rc,cc;
	int f;
	while (scanf("%d",&n),n!=0){
	    for (a=0;a<n;a++){
		    scanf("%d %d %d %d",&i[a],&p[a],&q[a],&r[a]);
			c[a]=4*p[a]+9*q[a]+4*r[a];
		}
		scanf("%d %d %d %d",&pc,&qc,&rc,&cc);
		f=0;
		for (a=0;a<n;a++){
		    if (pc[a]>=p[a]&&qc[a]>=q[a]&&rc[a]>=r[a]&&cc[a]>=c[a]){
			    printf("%d\n",i[a]);
			f=1;
			}
		}
		if (f==0){
		    printf("NA\n");
		}
	}
	return 0;
}

Compiler output:
a.cc:2:5: error: cannot declare '::main' to be a global variable
    2 | int main(main)
      |     ^~~~
a.cc:3:1: error: expected ',' or ';' before '{' token
    3 | {
      | ^
Language: C++

#include<stdio.h>
int main(void)
{
    int n,a,i[1010];
    int p[1010],q[1010],r[1010],c[1010];
	int pc,qc,rc,cc;
	int f;
	while (scanf("%d",&n),n!=0){
	    for (a=0;a<n;a++){
		    scanf("%d %d %d %d",&i[a],&p[a],&q[a],&r[a]);
			c[a]=4*p[a]+9*q[a]+4*r[a];
		}
		scanf("%d %d %d %d",&pc,&qc,&rc,&cc);
		f=0;
		for (a=0;a<n;a++){
		    if (pc[a]>=p[a]&&qc[a]>=q[a]&&rc[a]>=r[a]&&cc[a]>=c[a]){
			    printf("%d\n",i[a]);
			    f=1;
			}
		}
		if (f==0){
		    printf("NA\n");
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:27: error: invalid types 'int[int]' for array subscript
   16 |                     if (pc[a]>=p[a]&&qc[a]>=q[a]&&rc[a]>=r[a]&&cc[a]>=c[a]){
      |                           ^
a.cc:16:40: error: invalid types 'int[int]' for array subscript
   16 |                     if (pc[a]>=p[a]&&qc[a]>=q[a]&&rc[a]>=r[a]&&cc[a]>=c[a]){
      |                                        ^
a.cc:16:53: error: invalid types 'int[int]' for array subscript
   16 |                     if (pc[a]>=p[a]&&qc[a]>=q[a]&&rc[a]>=r[a]&&cc[a]>=c[a]){
      |                                                     ^
a.cc:16:66: error: invalid types 'int[int]' for array subscript
   16 |                     if (pc[a]>=p[a]&&qc[a]>=q[a]&&rc[a]>=r[a]&&cc[a]>=c[a]){
      |                                                                  ^
Language: C++

#include <stdio.h>
#include<iostream>
using namespace std;
int main()
{
	int pp = 4, qq = 9, rr = 4;
	while (1) {
		int n, P, Q, R, C, cou = 0;
		int okasi[1000][4];
		bool b;
		scanf_s("%d", &n);
		if (n == 0) break;
		for (int i = 0; i<n; ++i) {
			scanf_s("%d %d %d %d", &okasi[i][0], &okasi[i][1], &okasi[i][2], &okasi[i][3]);
		}
		scanf_s("%d %d %d %d", &P, &Q, &R, &C);
		cou = 0;
		for (int i = 0; i<n; ++i) {
			b = true;
			if (okasi[i][1] > P) b = false;
			if (okasi[i][2] > Q) b = false;
			if (okasi[i][3] > R) b = false;
			if (okasi[i][1] * pp + okasi[i][2] * qq + okasi[i][3] * rr > C) b = false;
			if (b == true) {
				printf("%d\n", okasi[i][0]); 
				++cou;
			}
		}
		if (cou == 0) printf("NA\n");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   11 |                 scanf_s("%d", &n);
      |                 ^~~~~~~
      |                 scanf
Language: C++

4
1 7 14 47
2 5 35 55
3 6 3 59
4 6 5 15
10 15 50 400
2
1 8 10 78
2 4 18 33
10 10 50 300
0

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

#include <iostream>
#include <vector>

#define calc(a, b, c) (4*a+8*b+4*c)

using namespace std;

class St
{
public:
  int id, p, q, r;
  St() {}
  St(int _id, int _p, int _q, int _r): id(_id), p(_p), q(_q), r(_r) {}

  void print(){
    cout << id << endl;
  }

  bool check(int s, int t, int u, int v){
    if(s < p || t < q || u < r) return false;
    if(calc(p, q, r) > v) return false;
    return true;
  }
}


int main()
{
  int n, s, t, u, v;
  vector<St> vec;
  bool f;

  while(cin >> n && n){
    for(int i = 0; i < n; ++i){
      cin >> s >> t >> u >> v;
      vec.push_back(St(s, t, u, v));
    }

    f = true;
    cin >> s >> t >> u >> v;
    for(int i = 0; i < n; ++i)
      if(vec[i].check(s, t, u, v)){
	f = false;
	vec[i].print();
      }

    if(f) cout << "NA" << endl;
    vec.clear();
  }

  return 0;
}

Compiler output:
a.cc:24:2: error: expected ';' after class definition
   24 | }
      |  ^
      |  ;
Language: C++

#include <iostream>
#include <vector>

#define calc(a, b, c) (4*a+8*b+4*c)

using namespace std;

class St
{
public:
  int id, p, q, r;
  St() {}
  St(int _id, int _p, int _q, int _r): id(_id), p(_p), q(_q), r(_r) {}

  void print(){
    cout << id << endl;
  }

  bool check(int s, int t, int u, int v){
    if(s <= p || t <= q || u <= r) return false;
    if(calc(p, q, r) => v) return false;
    return true;
  }
};

int main()
{
  int n, s, t, u, v;
  vector<St> vec;
  bool f;

  while(cin >> n && n){
    for(int i = 0; i < n; ++i){
      cin >> s >> t >> u >> v;
      vec.push_back(St(s, t, u, v));
    }

    f = true;
    cin >> s >> t >> u >> v;
    for(int i = 0; i < n; ++i)
      if(vec[i].check(s, t, u, v)){
	f = false;
	vec[i].print();
      }

    if(f) cout << "NA" << endl;
    vec.clear();
  }

  return 0;
}

Compiler output:
a.cc: In member function 'bool St::check(int, int, int, int)':
a.cc:21:23: error: expected primary-expression before '>' token
   21 |     if(calc(p, q, r) => v) return false;
      |                       ^
Language: C++

#include<iostream>
using namespace std;

struct cal{
	int i;
	int p;
	int q;
	int r;
	int c;
};

int main()
{
	int n, P, Q, R, C;
	struct cal *ans;
	bool flg;
	while(cin >> n && n!=0){
		ans = new struct cal[n];
		for(int i=0; i<n; i++){
			cin >> ans[i].i >> ans[i].p >> ans[i].q >> ans[i].r;
			ans[i].c = ans[i].p*4 + ans[i].q*9 + ans[i].r*4;
		}

		cin >> P >> Q >> R >> C;

		for(int i=0; i<n; i++){
			if(ans[i].p < P && ans[i].q < Q && ans[i].r < R && ans[i].c < C){
				cout << ans[i].i << endl;
			}
			else{
				flg = false;
				continue;
			}
			flg = true;
		}

		else if(!flg){
			cout << "NA" << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:17: error: 'else' without a previous 'if'
   37 |                 else if(!flg){
      |                 ^~~~
Language: C++

#include <stdio.h>
  int main(){
    int n,j;
    int x[1001][4];
    int p,q,r,c;
    scanf("%d",&n);
    for(j=0;j<n;j++){
      scanf("%d %d %d %d",&i,&x[j+1][1],&x[j+1][2],&x[j+1][3],&x[j+1][0);
}
printf("%d %d %d %d",&p,&q,&r,&c);
for(j=0;j<n;j++){
  if(x[j+1][1]<=p && x[j+1][2]<=q && x[j+1][3]<=r && x[j+1][0]<=c){
printf("%d\n",j+1);
}
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:28: error: 'i' was not declared in this scope
    8 |       scanf("%d %d %d %d",&i,&x[j+1][1],&x[j+1][2],&x[j+1][3],&x[j+1][0);
      |                            ^
a.cc:8:72: error: expected ']' before ')' token
    8 |       scanf("%d %d %d %d",&i,&x[j+1][1],&x[j+1][2],&x[j+1][3],&x[j+1][0);
      |                                                                        ^
      |                                                                        ]
Language: C++

#include <stdio.h>
  int main(){
    int n,j;
    int x[1001][4];
    int p,q,r,c;
    scanf("%d",&n);
    for(j=0;j<n;j++){
      scanf("%d %d %d %d",&i,&x[j+1][1],&x[j+1][2],&x[j+1][3],&x[j+1][0]);
}
printf("%d %d %d %d",&p,&q,&r,&c);
for(j=0;j<n;j++){
  if(x[j+1][1]<=p && x[j+1][2]<=q && x[j+1][3]<=r && x[j+1][0]<=c){
printf("%d\n",j+1);
}
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:28: error: 'i' was not declared in this scope
    8 |       scanf("%d %d %d %d",&i,&x[j+1][1],&x[j+1][2],&x[j+1][3],&x[j+1][0]);
      |                            ^
Language: C++

#include <stdio.h>
  int main(){
    int n,j,i;
    int x[1001][4];
    int p,q,r,c;
    scanf("%d",&n);
    for(j=0;j<n;j++){
      scanf("%d %d %d %d",&i,&x[j+1][1],&x[j+1][2],&x[j+1][3],&x[j+1][0]);
}
printf("%d %d %d %d",&p,&q,&r,&c);
for(j=0;j<n;j++){
int sum;
  if(x[j+1][1]<=p && x[j+1][2]<=q && x[j+1][3]<=r && x[j+1][0]<=c){
printf("%d\n",j+1);
}else{
sum++;
}
if(sum==n){
printf("NA\n");
}
return 0;
}

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