- #include
- void hello(char one, FILE*fp )
- {
- char letter;
- int num=0, ret;
-
-
- while(!feof(fp))
- {
- if(letter==one||letter+32==one)
- num++;
-
- ret = fscanf(fp, "%c", &letter);
- if (ret == EOF)
- break;
-
- }
-
- for(int i=0;i
- {
- printf("%c",one);
- }
- if(num!=0)
- {
- printf("\n");
- }
- }
- int main()
- {
- FILE *fp;
- if((fp=fopen("input.txt", "r"))==NULL){
- return -1;
- }
- char str[26];
- int i=0;
- str[0]='a';
- for (i=0; i<26; i++){
- str[i] = 'a' + i;
- hello(str[i], fp);
- rewind(fp);
- }
- fclose(fp);
- return 0;
- }