#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 41

int main (void)
{
FILE * fp;
char words [MAX];
if ((fp = fopen("text.txt", "a+")) == NULL)
{
fprintf (stdout, "not found \"text.txt\".\n");
exit(EXIT_FAILURE);
}
puts("put any worlds") ;
puts("put # on new line and exit.");
while ((fscanf(stdin,"%40s", words) == 1) && (words[0] != '#'))
fprintf(fp, ":regional_indicator_" "%s" ": " , words);
puts("print:") ;
fprintf(fp, "\n");
rewind(fp); /* return to EOF */
while (fscanf(fp,"%s" , words) == 1)
puts(words) ;
puts("pr sila pishi na si") ;
if (fclose ( fp) != 0)
fprintf (stderr, "error open file\n");
return 0;
}