#include <stdio.h>
#include <string.h>
#include <ctype.h>
intmain()
{
chars[1000],t;
inta[91],i,j,k;
FILE *u;
u=fopen("c:\\input.txt","rt");
for(k=65;k<=90;k++) a[k]=0;
while(!feof(u))
{
fflush(stdin);
fgets(s,1000,u);
for(j=0;j<strlen(s);j++)
{
t=toupper(s[j]);
if(t>='A'&&t<='Z') a[t]++;
}
//printf("\n%s",s);
}
fclose(u);
for(i=65;i<=90;i++)
if(a[i]!=0)
printf("\nKi tu %c xuat hien %d lan",i,a[i]);
}
No comments:
Post a Comment