Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- int main(){
- int counter = 0;
- FILE *fi;
- FILE *fo;
- char c = '\\';
- fi = fopen("input.txt","r");
- while (c != EOF){
- c = fgetc(fi);
- if (c == '\n'){
- counter++;
- }
- }
- fclose(fi);
- fo = fopen("output.txt","w");
- fprintf(fo,"%d",counter);
- fclose(fo);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement