printf("Player position: %d", player_position);
printf("\n");
printf("Player salary: %6.2f", player_salary);
printf("\n");
printf("Player summa: %7.2f", player_summa);
printf("\n");
}
void player::initialization(int in_id, int in_mainstat, int in_position, float in_salary, float in_summa)
{
player_id = in_id;
player_mainstat = in_mainstat;
player_position = in_position;
player_salary = in_salary;
player_summa = in_summa;
}
void player::pereopredilenie()
{
player_id = rand()%1000000;
player_mainstat = 0;
player_position = 0;
player_salary += rand()%10000;
player_summa += rand()%100000;
}
void main()
{
srand((unsigned)time(NULL));
printf("Kak vi hotite initializirovat' klacc?\n");
printf("1. Constructor \n");
printf("2. Initializator\n");
int choose;
scanf("%d", &choose);
if (choose == 1)
{
int choose_constructor;
printf("Choose the Constractor \n");
printf("1. Construstion Default\n");
printf("2. Construstion Another\n");
scanf("%d", &choose_constructor);
if (choose_constructor == 1)
{
player player_1;
int choose_result;
printf("Kak vi hotite polychit' rezul'tat?\n");
printf("1. Na ekrane\n");
printf("2. V faile\n");
scanf("%d", &choose_result);
if (choose_result == 1)
{
player_1.player_show();
int pereopr;
printf("Ne hotite li otredaktirovat' igroka?\n");
printf("Esli hotite, to nada vvesti: 11110\n");
printf("Ny a esli ne hotite, to nada vvesti: 11111\n");
scanf("%d", &pereopr);
if (pereopr == 11110)
{
player_1.pereopredilenie();
player_1.player_show();
}
if(pereopr == 11111)
{
return;
}
}
if (choose_result == 2)
{
file = fopen("result.txt", "w");
fprintf(file,"***********************************************************\n");
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.