fprintf(file,"* Id * Mainstat *Position* Salary * Summa *\n");
fprintf(file,"***********************************************************\n");
fprintf(file,"* %d *", player_1.player_id);
fprintf(file," %d *", player_1.player_mainstat);
fprintf(file," %d *", player_1.player_position);
fprintf(file," %6.2f *", player_1.player_salary);
fprintf(file," %7.2f *\n", player_1.player_summa);
fprintf(file,"************************************************************\n");
fclose(file);
}
}
}
if (choose == 2)
{
int id, mainstat, position;
float salary, summa;
player player_1;
printf("Enter player ID ");
scanf("%d", &id);
printf("Enter player main stat ");
scanf("%d", &mainstat);
printf("Enter player position ");
scanf("%d", &position);
printf("Enter player salary ");
scanf("%f", &salary);
printf("Enter player's summa kontrakta ");
scanf("%f", &summa);
player_1.initialization(id, mainstat, position, salary, summa);
//----------------- ðåçóëüòàòû
int choose_result;
printf("Kak vi hotite polychit rezultat?\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).
Ссылка на скачивание - внизу страницы.