虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

您现在的位置是:虫虫下载站 > 资源下载 > 源码 > 学生成绩管理啊

学生成绩管理啊

  • 资源大小:263 K
  • 上传时间: 2016-12-29
  • 上传用户:767483511
  • 资源积分:2 下载积分
  • 标      签: 学生专用

资 源 简 介

#include "string.h"
#include "ctype.h"
#include "stdio.h"
search(char pd[])
{FILE *fp;
 int time=0,i=0,j=0,add[80],k=0,m;
 char *ch,
 str[900];
 m=strlen(pd);
 if((fp=fopen("haha.txt","r"))==NULL)
 {
  printf("Cannot open this file\n");
  exit(0);
 }
for(;!feof(fp);i++)
 {
 str[i]=fgetc(fp);
  if(tolower(str[i])==tolower(pd[k]))
   {k++;
    if(k==m)
    if(!isalpha(i-m)&&!isalpha((str[i++]=fgetc(fp))))
    {
     time++;
     add[j]=i-m+1;
     j++;
     k=0;
    }
    else k=0;
  }
 }
  if(time)
 {
  printf("The time is:%d\n",time);
  printf("The adders is:\n");
  for(i=0;i<j;i++)
  printf("%5d",add[i]);
  if(i%5==0)
  printf("\n");
  getch();
  fclose(fp);
  }
  else
  printf("Sorry!Cannot find the word(^_^)");
}
main()
{
char pd[10],choose='y';
int flag=1;
    while(flag)
   {printf("In put the word you want to seqarch:");
    scanf("%s",pd);
    search(strlwr(pd));
    printf("\nWould you want to continue?(Y/N):");
    getchar();
    scanf("%c",&choose);
    if((tolower(choose))=='n')
    flag=0;
    else flag=1;
   }
  printf("Thanks for your using!Bye-bye!\n");
  getch();
}


相 关 资 源