#include <stdio.h>
int main()
{
FILE *fp = NULL;
char buff[255];
int s=0,k=0,z=0,sum=0,i=0;
fp = fopen("C:/Users/dell/Desktop/代码/test.txt", "w+");
fprintf(fp, "I love the world 123\n");
// fputs("I love the world 123\n", fp);
fclose(fp);
fp = fopen("C:/Users/dell/Desktop/代码/test.txt", "r");
// fscanf(fp, "%s", buff);
fgets(buff, 255, (FILE*)fp);
printf("%s\n", buff);
do{
if(buff[i]>='0'&&buff[i]<='9')s++;
else if(buff[i]==' ')k++;
else if(buff[i]>='a'&&buff[i]<='z'||buff[i]>='A'&&buff[i]<='Z')z++;
sum++;
i++;
}while(buff[i]!='\n');
printf("数字:%d 空格:%d 字母:%d 总:%d",s,k,z,sum);
fclose(fp);
}