Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- FILE *f1, *f2;
- f1=fopen("in.txt", "r");
- f2=fopen("out.txt", "w");
- int f=0;
- char c;
- while((c=fgetc(f1))!=EOF){
- if(c==' '){
- if(f==0){
- fputc(c,f2);
- f=1;
- }
- }
- else{
- f=0;
- fputc(c,f2);
- }
- }
- fprintf(f2,"\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement