Could you help me and tell me what is wrong with the following exercise and how to improve it?
The statement is:
In this exercise we will program the game of the simplified hangman. At the beginning we will ask the first player for the secret word and then we will erase the screen with the command system ("cls"); (so that the second player does not see it).
The second player will have three opportunities to hit the floor. If in any of the three successful attempts we will congratulate you and the program will end. If it fails all three attempts we will tell you that it has lost and we will show the hidden word. In each attempt we will give the user a clue: in the first attempt we will show the first letter of the chain, in the second attempt the last and in the third the central letter.
#include<stdio.h>
#include<string.h>
int main(void){
char pj1[50],pa[50],pb[50],pc[50];
printf("Ha comenzado el juego del ahorcado\n");
printf ("jugador 1, introduzca la palabra secreta:");
scanf("%s",pj1);
system("cls");
printf("Jugador 2,solo tienes 3 intentos\n");
printf("Primer intento:(Pista)Empieza por la letra %c:",pj1[0]);
scanf("%s",pa);
int a=strcmp(pj1,pa);
int n=strlen(pj1);
if( a!=0)
{
printf("Segundo intento:(Pista)Termina por la letra %c:",pj1[n-1]);
scanf("%s",pa);
a=strcmp(pj1,pa);
}
if( a!=0)
{
printf("Tercer intento:(Pista)Contiene la letra %c:",pj1[(n-1)/2]);
scanf("%s",pa);
a=strcmp(pj1,pa);
}
if( pa==0){printf("¡Felicidades, acertaste\n");
}else{printf("Lo siento, has perdido. La palabra era %s\n",pj1);}
return 0;
}