#include
main(){
FILE *fp;
int space=0;
char str[81];
fp=fopen("filename.txt","rb");
while(1){
fgets(str,80,fp);
if(feof(fp))
break;
if((str[0]=='\r')&&(str[1]=='\n'))
space++;
}
fclose(fp);
printf("\n In file have %d space line.",space);
getch();
}
Subscribe to:
Post Comments (Atom)
0 评论:
Post a Comment