learningc/chapters/1/exercises/18.c

21 lines
490 B
C

#include <stdio.h>
#include "shared/limits.h"
#include "shared/functions.h"
#include "shared/functions/getlines.c"
int main() {
char line[MAXLINE], prostr[MAXLINE];
int len;
int skip = 0;
while ((len = getlines(line, MAXLINE)) > 0) {
for (int i=len; !(i < 0); --i) {
if (skip != 0 || !(line[i] == ' ' || line[i] == '\n' || line[i] == '\t' || line[i] == '\0')) {
prostr[i] = line[i];
skip = 1;
}
}
}
printf("\"%s\"\n", prostr);
return 0;
}