foo.cc: In function 'int main()':
foo.cc:10:30: warning: unused variable 'h' [-Wunused-variable]
int head1,back2,i,n,k,j,h;
^
foo.cc:11:10: warning: unused variable 'head' [-Wunused-variable]
char head,back,a[50];
^~~~
foo.cc:12:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d %d",&head1,&back2,&n);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:17:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%c",&a[i]);
~~~~~^~~~~~~~~~~~