Language: C++

#iniclude<iostream>
using namespace std;

int main(){
	while(true){
		int M, T, P, R;
 		cin >> M >> T >> P >> R;
	
		if(M==0 && T==0 && P==0 && R==0)
			break;
		
		int CP[50], TT[50], PT[50][10];
		for(int i=0;	i<T; i++){
			CP[i] = TT[i] = 0;
			for(int j=0; j<P; j++)
				PT[i][j] = 0;
		}

		for(int i=0; i<R; i++){
			int m, t, p, r;
			cin >> m >> t >> p >> r;
			
			if(j==0){
				CP[t-1]++;
				TT[t-1] += (m+PT[t-1[p-1]);
			}
			else{
				PT[t-1][p-1] += 20;
			}
		}
	
		int tnow, tpre = -1;
		bool flg[50];
			flg[i] = false;
				
		for(int i=0; i<T; i++){
			tnow = -1;
			for(int j=0; j<T; j++){
				if(flg[j])
					continue;
				if(tnow==-1){
					tnow = j;
				}
				else{
					if(CP[j]>CP[tnow] || (CP[j]==CP[tnow] && TT[j]==TT[tnow])){
					}
				}
			}
			
			if(tpre!=-1){
				if(CP[tnow]==CP[tpre] && tt[tnow]==TT[tpre])
					cout << '=';
				else
					cout << ',';
				}
				cout << tnow+1;
				
				flg [tnow] = true;
				tpre = tnow;

			}
		cout << endl;
	}
	return 0;
}




Compiler output:
a.cc:1:2: error: invalid preprocessing directive #iniclude; did you mean #include?
    1 | #iniclude<iostream>
      |  ^~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:17: error: 'cin' was not declared in this scope
    7 |                 cin >> M >> T >> P >> R;
      |                 ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #iniclude<iostream>
a.cc:23:28: error: 'j' was not declared in this scope
   23 |                         if(j==0){
      |                            ^
a.cc:25:53: error: invalid types 'int[int]' for array subscript
   25 |                                 TT[t-1] += (m+PT[t-1[p-1]);
      |                                                     ^
a.cc:25:58: error: expected ']' before ')' token
   25 |                                 TT[t-1] += (m+PT[t-1[p-1]);
      |                                                          ^
      |                                                          ]
a.cc:34:29: error: 'i' was not declared in this scope
   34 |                         flg[i] = false;
      |                             ^
a.cc:51:58: error: 'tt' was not declared in this scope; did you mean 'TT'?
   51 |                                 if(CP[tnow]==CP[tpre] && tt[tnow]==TT[tpre])
      |                                                          ^~
      |                                                          TT
a.cc:52:41: error: 'cout' was not declared in this scope
   52 |                                         cout << '=';
      |                                         ^~~~
a.cc:52:41: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:54:41: error: 'cout' was not declared in this scope
   54 |                                         cout << ',';
      |                                         ^~~~
a.cc:54:41: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:56:33: error: 'cout' was not declared in this scope
   56 |                                 cout << tnow+1;
      |                                 ^~~~
a.cc:56:33: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:62:17: error: 'cout' was not declared in this scope
   62 |                 cout << endl;
      |                 ^~~~
a.cc:62:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:62:25: error: 'endl' was not declared in this scope
   62 |                 cout << endl;
      |                         ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #iniclude<iostream>