欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來到入門教程網(wǎng)!

C語(yǔ)言

當(dāng)前位置:主頁(yè) > 軟件編程 > C語(yǔ)言 >

C++基礎(chǔ)學(xué)生管理系統(tǒng)

來源:本站原創(chuàng)|時(shí)間:2020-01-10|欄目:C語(yǔ)言|點(diǎn)擊: 次

本文實(shí)例為大家分享了C++基礎(chǔ)學(xué)生管理系統(tǒng)的實(shí)現(xiàn)代碼,供大家參考,具體內(nèi)容如下

適用于c++6.0,codeblocks等常用工具

1. 鏈表處理部分    

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
 
#include"linklist.h"
#include"elem.h"
 
 
void dispnode(linklist h)
{
 node *p;
 p=h->next;
 while(p)
 {
  dispelem(p);
  p=p->next;
 }
 
}
 
int inputnode(linklist h,T e)
{
 node *p;
 node *q;
 p=h;
 while(p->next&& (p->next->data).id<=e.id)
 {
  if((p->next->data).id==e.id)
   return 0;
  p=p->next;
 }
 q=(node*)malloc(sizeof(node));
 q->data=e;
 q->next=p->next;
 p->next=q;
 return 1;
}
 
int delnode(linklist h,int id)
{
 node *p;
 p=h;
 while(p->next&&(p->next->data).id!=id)
  p=p->next;
 if(p->next)
 {
  node *t=p->next;
  p->next=t->next;
  free(t);
  return 1;
 
 }
 else
  return 0;
 
}
 
node* searchname(linklist h,char name[])
{
 node *p;
 p=h-next;
 while( p && strcmp((p->data).name ,name)!=0)
  p=p->next;
 return p;
}
 
node* searchid(linklist h,int id)
{
 node *p;
 p=h->next;
 while( p->next && (p->next->data).id <= e.id )
  p=p->next;
 return p;
}

2. 數(shù)據(jù)處理部分    

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
 
#include"linklist.h"
#include"elem.h"
 
 
void dispnode(linklist h)
{
 node *p;
 p=h->next;
 while(p)
 {
  dispelem(p);
  p=p->next;
 }
 
}
 
int inputnode(linklist h,T e)
{
 node *p;
 node *q;
 p=h;
 while(p->next&& (p->next->data).id<=e.id)
 {
  if((p->next->data).id==e.id)
   return 0;
  p=p->next;
 }
 q=(node*)malloc(sizeof(node));
 q->data=e;
 q->next=p->next;
 p->next=q;
 return 1;
}
 
int delnode(linklist h,int id)
{
 node *p;
 p=h;
 while(p->next&&(p->next->data).id!=id)
  p=p->next;
 if(p->next)
 {
  node *t=p->next;
  p->next=t->next;
  free(t);
  return 1;
 
 }
 else
  return 0;
 
 
 
 
}
 
node* searchname(linklist h,char name[])
{
 node *p;
 p=h-next;
 while( p && strcmp((p->data).name ,name)!=0)
  p=p->next;
 return p;
}
 
node* searchid(linklist h,int id)
{
 node *p;
 p=h->next;
 while( p->next && (p->next->data).id <= e.id )
  p=p->next;
 return p;
}


3. 文件處理部分    

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
 
#include"linklist.h"
#include"elem.h"
 
 
void dispnode(linklist h)
{
 node *p;
 p=h->next;
 while(p)
 {
  dispelem(p);
  p=p->next;
 }
 
}
 
int inputnode(linklist h,T e)
{
 node *p;
 node *q;
 p=h;
 while(p->next&& (p->next->data).id<=e.id)
 {
  if((p->next->data).id==e.id)
   return 0;
  p=p->next;
 }
 q=(node*)malloc(sizeof(node));
 q->data=e;
 q->next=p->next;
 p->next=q;
 return 1;
}
 
int delnode(linklist h,int id)
{
 node *p;
 p=h;
 while(p->next&&(p->next->data).id!=id)
  p=p->next;
 if(p->next)
 {
  node *t=p->next;
  p->next=t->next;
  free(t);
  return 1;
 
 }
 else
  return 0;
 
 
 
 
}
 
node* searchname(linklist h,char name[])
{
 node *p;
 p=h-next;
 while( p && strcmp((p->data).name ,name)!=0)
  p=p->next;
 return p;
}
 
node* searchid(linklist h,int id)
{
 node *p;
 p=h->next;
 while( p->next && (p->next->data).id <= e.id )
  p=p->next;
 return p;
}

4. 主菜單自定義部分

#include <stdio.h>
#include <stdlib.h>
 
 
#include "linklist.h"
#include "elem.h"
#include "fileop.h"
 
void mainmenu();
 
void searchlinklist(linlist h)
{
 linklist h;
 h=(linklist)malloc(sizeof(node));
 h->next=NULL;
 loadfile(h);
 mainmenu(h);
 savefile(h);
 printf("\n");
 return 0;
}
void mainmenu()
{
 node *p;
 int id;
 T e;
 int select;
 int count=1;
 do
 {
  printf("\n");
  printf(" ----------------¡¶SSMGS OS¡· ---------------\n");
  printf("  1 displaying 2 searching 3 adding 4 deleting\n\n");
  printf("     5 changing 6 extiting \n");
  printf(" --------------------welcome ------------------------\n");
  printf("please input your select: ");
  scanf("%d", &select);
  switch(select)
  {
  case 1:
   dispnode(h);
   break;
  case 2:
   searchlinlist(h);
   break;
  case 3:
   inputelem(&e);
   if(inputnode(h,e))
    printf("succeed\n");
   else
    printf("failed\n");
   break;
  case 4:
   printf("please input id:");
   scanf("%d",&id);
 
   break;
  case 5://功能引用
   break;
  case 6://功能引用
   count=0;
   break;
  }
 
 }while(count);
 
}

5.頭文件集合部分

elem.h部分

#ifndef LINKLIST_H_INCLUDED
#define LINKLIST_H_INCLUDED
 
#include"elem.h"
 
 
typedef struct node
{
 T data;
 struct node *next;
}node;
 
typedef node* linklist;
 
void dispnode(linklist h);
 
int inputnode(linklist h,T e);
 
int delnode(linklist h,int id);
 
node* searchname(linklist h,char name[]);
 
node* searchid(linklist h,int id);
 
 
 
 
 
 
#endif // LINKLIST_H_INCLUDED
 
fileop.h部分
 
#ifndef FILEOP_H_INCLUDED
#define FILEOP_H_INCLUDED
 
#include"linklist.h"
 
void savefile(linklist h);
 
 
void loadfile(linklist h);
 
 
 
#endif // FILEOP_H_INCLUDED
 
 
linklist.h部分
 
#ifndef LINKLIST_H_INCLUDED
#define LINKLIST_H_INCLUDED
 
#include"elem.h"
 
 
typedef struct node
{
 T data;
 struct node *next;
}node;
 
typedef node* linklist;
 
void dispnode(linklist h);
 
int inputnode(linklist h,T e);
 
int delnode(linklist h,int id);
 
node* searchname(linklist h,char name[]);
 
node* searchid(linklist h,int id);
 
#endif // LINKLIST_H_INCLUDED

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家學(xué)習(xí)C++語(yǔ)言有所幫助。

上一篇:C語(yǔ)言實(shí)現(xiàn)五子棋小游戲

欄    目:C語(yǔ)言

下一篇:希爾排序算法的C語(yǔ)言實(shí)現(xiàn)示例

本文標(biāo)題:C++基礎(chǔ)學(xué)生管理系統(tǒng)

本文地址:http://mengdiqiu.com.cn/a1/Cyuyan/2402.html

網(wǎng)頁(yè)制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語(yǔ)言數(shù)據(jù)庫(kù)服務(wù)器

如果侵犯了您的權(quán)利,請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有