#include<stdio.h>
#include<conio.h> char c[100];
void docfile(int &n)
{
FILE *f;
f=fopen("chua.txt","rt");
int i=0;
fscanf(f," %c",&c[i]);//đọc kí tự trước
while(!feof(f))//kiểm tra xem nó cuối tệp chưa
{
printf("\n %d",c[i]);
i++;
fscanf(f," %c",&c[i]);
}
c[i]='\0';
n=i;
fclose(f);
} void ghifile(int n)
{
FILE *f;
f=fopen("taofilekq.txt","wt");
int i=0;
while(i<n)
{
if(c[i]>0&&c[i]!=32)
{
{
fprintf(f,"%d \n",c[i]);
}
}
i++;
}
fclose(f);
}
void main()
{
int n;
docfile(n);
ghifile(n);
}
#include<conio.h> char c[100];
void docfile(int &n)
{
FILE *f;
f=fopen("chua.txt","rt");
int i=0;
fscanf(f," %c",&c[i]);//đọc kí tự trước
while(!feof(f))//kiểm tra xem nó cuối tệp chưa
{
printf("\n %d",c[i]);
i++;
fscanf(f," %c",&c[i]);
}
c[i]='\0';
n=i;
fclose(f);
} void ghifile(int n)
{
FILE *f;
f=fopen("taofilekq.txt","wt");
int i=0;
while(i<n)
{
if(c[i]>0&&c[i]!=32)
{
{
fprintf(f,"%d \n",c[i]);
}
}
i++;
}
fclose(f);
}
void main()
{
int n;
docfile(n);
ghifile(n);
}