#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>

#include<stdlib.h>

#include<string.h>

int main()

{    int size;

FILE *fp=fopen("words.txt", "r");

fseek(fp, 0, SEEK_END);

size=ftell(fp);

fseek(fp, 0, SEEK_SET);

char *buffer=malloc(size+1);

fread(buffer, sizeof(size+1), 4, fp);

memset(buffer, 0, sizeof(size+1));

FILE *fp2=fopen("words2.txt", "w");

for(int i=size-1; i>=0; i--)

{

fwrite(&buffer[i], sizeof(char), 1, stdout);

memset(buffer,0, sizeof(size+1));

}

fclose(fp);

fclose(fp2);

free(buffer);

return 0;

}