#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main (void) {
FILE *fp;
char str [1024];
if ((fp = fopen ("out.txt", "r")) == NULL) {
perror ("Can't open file");
exit(1);
}
printf ("<ul>");
while (!feof(fp)) {
fgets (str, 1024, fp);
str [strlen(str)-1] = 0;
printf ("<li><a href=\"%s\">%s</a></li>\n", str, str);
}
printf ("</ul>");
fclose (fp);
return 0;
}