kiem tien, kiem tien online, kiem tien truc tuyen, kiem tien tren mang
Thursday, January 8, 2015

//chương trình đếm số từ trong file
#include<stdio.h>
#include<stdlib.h>
void main()
{
FILE *t;
int k=0,dem=0;
t=fopen("E:\\toan.txt","r");
if(t==NULL)
{
printf("error");
exit(0);
}
char c;
do
{
c=getc(t);
if((c>='a' && c<='z' )||(c>='A' && c<='Z'))k=1;
if((c==' ' || c=='\t' || c==10 || c==EOF)&&k==1 )
{
dem++;
k=0;
}
}while(c!=EOF);
printf("so tu = %d\n",dem);
}

0 comments:

Post a Comment

domain, domain name, premium domain name for sales

Popular Posts