Language: C++

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

struct data{

	char name[20];
	int win;
	int lose;
	int draw;
	int score;

};

int main(){

	int teamamo;

	while (true){

		cin >> teamamo;

		if (teamamo == 0)
			break;

		data teamdata[10];
		

		for (int i = 0; i<teamamo; i++)
			cin >> teamdata[i].name >> teamdata[i].win >> teamdata[i].lose >> teamdata[i].draw;

		for (int i = 0; i<teamamo; i++)
			teamdata[i].score = teamdata[i].win * 3 + teamdata[i].draw;


		for (int j = 0; j < teamamo - 1; j++){
			for (int i = 0; i < teamamo - 1; i++){

				if (teamdata[i].score < teamdata[i + 1].score){

					char fout[20];
					strcpy_s(fout, teamdata[i].name);
					strcpy_s(teamdata[i].name, teamdata[i + 1].name);
					strcpy_s(teamdata[i + 1].name, fout);

					int gout;
					gout = teamdata[i].score;
					teamdata[i].score = teamdata[i + 1].score;
					teamdata[i + 1].score = gout;

				}

			}


		}

		for (int i = 0; i<teamamo; i++)
			cout << teamdata[i].name << ',' << teamdata[i].score << endl;


	}

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: reference to 'data' is ambiguous
   26 |                 data teamdata[10];
      |                 ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:5:8: note:                 'struct data'
    5 | struct data{
      |        ^~~~
a.cc:30:32: error: 'teamdata' was not declared in this scope
   30 |                         cin >> teamdata[i].name >> teamdata[i].win >> teamdata[i].lose >> teamdata[i].draw;
      |                                ^~~~~~~~
a.cc:33:25: error: 'teamdata' was not declared in this scope
   33 |                         teamdata[i].score = teamdata[i].win * 3 + teamdata[i].draw;
      |                         ^~~~~~~~
a.cc:39:37: error: 'teamdata' was not declared in this scope
   39 |                                 if (teamdata[i].score < teamdata[i + 1].score){
      |                                     ^~~~~~~~
a.cc:42:41: error: 'strcpy_s' was not declared in this scope; did you mean 'strcpy'?
   42 |                                         strcpy_s(fout, teamdata[i].name);
      |                                         ^~~~~~~~
      |                                         strcpy
a.cc:59:33: error: 'teamdata' was not declared in this scope
   59 |                         cout << teamdata[i].name << ',' << teamdata[i].score << endl;
      |                                 ^~~~~~~~