Language: C++

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

int n,P,Q,R,C,flag;
struct DATA{
int name,p,f,c,cal,sum,flag;
}
DATA data[1001];

int main(){
	while(1){
		flag=0;
		for(int i=0;i<n;i++){data[i].flag=0;}
		cin>>n;
		if(n==0){break;}
		for(int i=0;i<n;i++){
			cin>>data[i].name>>data[i].p>>data[i].f>>data[i].c;
			data[i].cal=data[i].p*4+data[i].f*9+data[i].c*4;
		}
		cin>>P>>Q>>R>>C;
		for(int i=0;i<n;i++){
			if(data[i].p<=P && data[i].f<=Q && data[i].c<=R && data[i].cal<=C){
				data[i].flag=1;
			}
		}
		for(int i=0;i<n;i++){
			if(data[i].flag==1){
				cout<<data[i].name<<endl;
				flag++;
			}
		}
		if(flag==0){cout<<"NA"<<endl;}
	}
	return 0;
}

Compiler output:
a.cc:11:6: error: expected initializer before 'data'
   11 | DATA data[1001];
      |      ^~~~
a.cc: In function 'int main()':
a.cc:16:42: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   16 |                 for(int i=0;i<n;i++){data[i].flag=0;}
      |                                          ^
a.cc:20:34: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   20 |                         cin>>data[i].name>>data[i].p>>data[i].f>>data[i].c;
      |                                  ^
a.cc:20:48: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   20 |                         cin>>data[i].name>>data[i].p>>data[i].f>>data[i].c;
      |                                                ^
a.cc:20:59: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   20 |                         cin>>data[i].name>>data[i].p>>data[i].f>>data[i].c;
      |                                                           ^
a.cc:20:70: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   20 |                         cin>>data[i].name>>data[i].p>>data[i].f>>data[i].c;
      |                                                                      ^
a.cc:21:29: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   21 |                         data[i].cal=data[i].p*4+data[i].f*9+data[i].c*4;
      |                             ^
a.cc:21:41: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   21 |                         data[i].cal=data[i].p*4+data[i].f*9+data[i].c*4;
      |                                         ^
a.cc:21:53: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   21 |                         data[i].cal=data[i].p*4+data[i].f*9+data[i].c*4;
      |                                                     ^
a.cc:21:65: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   21 |                         data[i].cal=data[i].p*4+data[i].f*9+data[i].c*4;
      |                                                                 ^
a.cc:25:32: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   25 |                         if(data[i].p<=P && data[i].f<=Q && data[i].c<=R && data[i].cal<=C){
      |                                ^
a.cc:25:48: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   25 |                         if(data[i].p<=P && data[i].f<=Q && data[i].c<=R && data[i].cal<=C){
      |                                                ^
a.cc:25:64: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   25 |                         if(data[i].p<=P && data[i].f<=Q && data[i].c<=R && data[i].cal<=C){
      |                                                                ^
a.cc:25:80: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   25 |                         if(data[i].p<=P && data[i].f<=Q && data[i].c<=R && data[i].cal<=C){
      |                                                                                ^
a.cc:26:37: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   26 |                                 data[i].flag=1;
      |                                     ^
a.cc:30:32: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   30 |                         if(data[i].flag==1){
      |                                ^
a.cc:31:43: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   31 |                                 cout<<data[i].name<<endl;
      |                                           ^