Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<string.h>
- #include<ctype.h>
- #define max 80
- int main(int argc,char *argv[])
- {
- if(argc!=2)
- {
- printf("GRESKA\n");
- return -1;
- }
- FILE *in1;
- char s[max],*c;
- int red,vozbor=0,zbor;
- in1=fopen(argv[1],"r");
- if(in1==NULL)
- {
- printf("NEMA TAKVA DATOTEKA\nUpatstvo%s\t",argv[0]);
- return -1;
- }
- while(fgets(s,max,in1)!=NULL)
- {
- c=s;
- zbor=vozbor=0;
- while(*c!='\n')
- {
- if(isalnum(*c))
- {
- if(vozbor==0)
- vozbor=1;
- }
- else
- if(vozbor!=0)
- {
- vozbor=0;
- zbor++;
- }
- c++;
- }
- if (vozbor!=0) zbor++;
- if (zbor >= 10) red++;
- }
- printf("Vkupno %d redovi imaat povekje od 10 zborovi\n",red);
- return(0);
- }
- //datoteka broj kolku reda imat povekje od 2 zborovi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement