赞赞麋 发表于 2020-7-4 15:58:07

怎样改,才能符合要求

在执行此函数时要求先输入密码,密码是六位数的
void del()
{      
        int i,j,del_num,match=0;
      char c;
      system("cls");
      printf("请输入要删除的学生学号:\n");
      scanf("%d",&del_num);
      waiting();
      for(i=0;i<count;i++)
      {
                if(stu.num==del_num)
                {
                        match=1;
                        for(j=i;j<count;j++)
                        stu=stu;
                }
      }
      if(!match)
                printf("没有要找的学号.\n");
      printf("是否继续删除?(y/n)");
      fflush(stdin);
      do
                {
                        c=getchar();
                        if(c=='y'||c=='Y')
                        {
                              count--;
                              del();
                        }
                        else if(c=='n'||c=='N')
                        {
                              count--;
                              system("cls");
                              homepage();
                        }
                        else;
                }while((c!='y')&&(c!='n'));

}

qiuyouzhi 发表于 2020-7-4 16:02:22

把代码发完整
页: [1]
查看完整版本: 怎样改,才能符合要求