Language: C++

#include<iostream>
#include<vector>
#include<string.h>

using namespace std;

struct log{
	int id,belong,correct,penalty;
};

int main(void){
	
	struct log team[1001];
	int n,idcount[1001];

	while(cin>>n,n){
		
		memset(team,0,sizeof(team));
		memset(idcount,0,sizeof(idcount));
		
		for(int i=1;i<=n;i++){
			cin>>team[i].id>>team[i].belong>>team[i].correct>>team[i].penalty;
		}
		
		for(int i=1;i<=n;i++){
			for(int j=n;j>=i+1;j--){
				if(team[j-1].correct<team[j].correct){
					struct log temp;
					temp=team[j];
					team[j]=team[j-1];
					team[j-1]=temp;
				}
			}
		}

		for(int i=1;i<=n;i++){
			for(int j=n;j>=i+1;j--){
				if(team[j-1].correct==team[j].correct && team[j-1].penalty>team[j].penalty){
					struct log temp;
					temp=team[j];
					team[j]=team[j-1];
					team[j-1]=temp;
				}
			}
		}
			
		for(int i=1;i<=n;i++){
			for(int j=n;j>=i+1;j--){
				if(team[j-1].correct==team[j].correct && team[j-1].penalty==team[j].penalty && team[j-1].id>team[j].id){
					struct log temp;
					temp=team[j];
					team[j]=team[j-1];
					team[j-1]=temp;
				}
			}
		}
	
		
		for(int i=1,sum=0;i<=n;i++){
			if(sum<10 && idcount[team[i].belong]<3){
				cout<<team[i].id<<endl;
				idcount[team[i].belong]++;
				sum++;
			}
			else if(sum<=10 && sum<20 && idcount[team[i].belong]<2){
				cout<<team[i].id<<endl;
				idcount[team[i].belong]++;
				sum++;
			}
			else if(sum<=20 && sum<26 && idcount[team[i].belong]==0){
				cout<<team[i].id<<endl;
				idcount[team[i].belong]++;
				sum++;
			}
		}
	}
}iostream>
#include<vector>
#include<string.h>

using namespace std;

struct log{
	int id,belong,correct,penalty;
};

int main(void){
	
	struct log team[1001];
	int n,idcount[1001];

	while(cin>>n,n){
		
		memset(team,0,sizeof(team));
		memset(idcount,0,sizeof(idcount));
		
		for(int i=1;i<=n;i++){
			cin>>team[i].id>>team[i].belong>>team[i].correct>>team[i].penalty;
		}
		
		for(int i=1;i<=n;i++){
			for(int j=n;j>=i+1;j--){
				if(team[j-1].correct<team[j].correct){
					struct log temp;
					temp=team[j];
					team[j]=team[j-1];
					team[j-1]=temp;
				}
			}
		}

		for(int i=1;i<=n;i++){
			for(int j=n;j>=i+1;j--){
				if(team[j-1].correct==team[j].correct && team[j-1].penalty>team[j].penalty){
					struct log temp;
					temp=team[j];
					team[j]=team[j-1];
					team[j-1]=temp;
				}
			}
		}
			
		for(int i=1;i<=n;i++){
			for(int j=n;j>=i+1;j--){
				if(team[j-1].correct==team[j].correct && team[j-1].penalty==team[j].penalty && team[j-1].id>team[j].id){
					struct log temp;
					temp=team[j];
					team[j]=team[j-1];
					team[j-1]=temp;
				}
			}
		}
	
		
		for(int i=1,sum=0;i<=n;i++){
			if(sum<10 && idcount[team[i].belong]<3){
				cout<<team[i].id<<endl;
				idcount[team[i].belong]++;
			}
			else if(sum<=10 && sum<20 && idcount[team[i].belong]<2){
				cout<<team[i].id<<endl;
				idcount[team[i].belong]++;
			}
			else if(sum<=20 && sum<26 && idcount[team[i].belong]==0){
				cout<<team[i].id<<endl;
				idcount[team[i].belong]++;
				sum++;
			}
		}
	}
}

Compiler output:
a.cc:77:10: error: expected unqualified-id before '>' token
   77 | }iostream>
      |          ^
a.cc:83:8: error: redefinition of 'struct log'
   83 | struct log{
      |        ^~~
a.cc:7:8: note: previous definition of 'struct log'
    7 | struct log{
      |        ^~~
a.cc:87:5: error: redefinition of 'int main()'
   87 | int main(void){
      |     ^~~~
a.cc:11:5: note: 'int main()' previously defined here
   11 | int main(void){
      |     ^~~~