Gege
Gege
#include <string>
using namespace std;
struct athlete
{
string name, sports, team, birthplace, status, ask;
char sex;
int age, years;
double salary;
}
char athlete ath[10];
void main(void)
{
ath info;
for (int i = 0; i < 10; i++)
{
cout << "Enter sports playing: ";
cin >> info[i].sports;
cout << "Enter team name: ";
cin >> info[i].team;
cin.ignore();
cout << "Enter name: ";
getline(cin, info[i].name);
cout << "Is this athlete still playing or retired: ";
cin >> info[i].ask;
cout << "Enter age: ";
cin >> info[i].age;
cin.ignore();
cout << "Enter birthplace: ";
getline(cin, info[i].birthplace);
cout << "Enter sex: ";
cin >> info[i].sex;
cout << "Enter civil status: ";
cin >> info[i].status;
cout << "Enter years playing: ";
cin >> info[i].years;
cout << "Enter money gained while playing: ";
cin >> info[i].salary;
}
cout << "Sports Playing" << "\t" << "Team Name" << "\t" << "Name" << "\t" <<
"Retired/Playing" << "\t" << "Age" << "\t" << "Birthplace" << "\t" << "Sex" << "\t"
<< "Civil Status" << "\t" << "Number of Years Playing" << "\t" << "Money gained" <<
"\t";