>>117 strlen と isspace の定義が無い warning が出るけど
#include <stdio.h>
#define SIZE 100
#define TRUE 1
#define FALSE 0
int main(void)
{
char line[SIZE], c;
int lno=0; /* the number of lines */
int wno=0; /* the number of words */
int cno=0; /* the number of characters */
int n, i, flag;
while (fgets(line, SIZE, stdin) != NULL) {
flag=TRUE;
n=strlen(line);
cno+=n;
if(line[n-1]=='\n') line[n--]='\0';
for(i=0;i<n/2;i++)
c=line[i],line[i]=line[n-1-i],line[n-1-i]=c;
for(i=0;i<n;i++){
if(isspace(line[i])) flag=TRUE;
else{
if(flag==TRUE) wno++;
flag=FALSE;
}
}
printf("%s", line);
lno++;
}
printf("\n%d lines, %d words, %d characters\n", lno, wno, cno);
return 0;
}