#include #include #include int main(int argc, const char * argv[]) { if(argc < 3) { printf("Vlezna datoteka i izlezna treba da se vnesat kako argument\n"); return 0; } FILE *in = fopen(argv[1], "r"); FILE * out = fopen(argv[2], "w"); if(in == NULL) { printf("Fajlot ne postoi\n"); return 0; } if(out == NULL) { printf("Fajlot ne postoin\n"); return 0; } char s[2000]; int red = 1, brojac = 0;; while(fgets(s, 1000, in) != NULL) { int spaces = 1; for(int i = 0; i < strlen(s); i++) { if(isspace(s[i])) { spaces++; } } if(spaces > 4) { fprintf(out, "Red %d\n", red); brojac++; } red++; } fprintf(out, "Postojat %d takvi redovi\n", brojac); return 0; }