GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
#include "typedef.h"12/***************************************************************************3@4@---------------------------------------------------------------------------5@ FILE: put_word.c6@---------------------------------------------------------------------------7@8****************************************************************************/910/***************************************************************************11@12@---------------------------------------------------------------------------13@14@ void put_word(int *w,15@ char *O)16@ outputs the word w to stdout.17@ the string O contatins the options. If O contains a 'G', the output18@ is done in gap format, if O contains a 'M', the output is19@ done in matrix format. Both is possible simultanously.20@---------------------------------------------------------------------------21@22****************************************************************************/23void put_word(int *w,24char *O)25{2627int i;2829if (strchr(O,'G')){30if (w[0] == 0){31printf("g[1]*g[1]^(-1)");32}33else{34for(i=1;i<w[0];i++){35if (w[i] > 0){36printf("g[%d]*",w[i]);37}38else{39printf("g[%d]^(-1)*",-w[i]);40}41if (!(i % 10)) printf("\n");42}43if (w[i] > 0){44printf("g[%d]",w[i]);45}46else{47printf("g[%d]^(-1)",-w[i]);48}49}5051printf("\n");52}5354if (strchr(O,'M')){55if (w[0] == 0){56printf("c 1 -1");57}58else{59printf("c ");60for(i=1;i<=w[0];i++)61printf("%d ",w[i]);62}6364printf("\n");65}666768fflush(stdout);6970return;7172} /* put_word(...) */73747576