#include #define MAXLINE 1000 /* maximum input line size */ int getln(char line[], int maxline); void reverse(char to[], char from[], int len); /* reverse the input line */ int main() { int len; /* current line length */ char line[MAXLINE]; /* current input line */ char rline[MAXLINE]; /* reversed line */ while ((len = getln(line, MAXLINE)) > 0) { reverse(rline, line, len); printf("%s", rline); } return 0; } /* getln: read a line into s, return length */ int getln(char s[], int lim) { int c, i; for (i=0; i