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);
}
08 Jan 2015

0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

domain, domain name, premium domain name for sales

Popular Posts