?? student.cpp
字號:
#include <string.h>
#include"student.h"
void student::read_name (char N[])
{ strcpy(sname,N); }
void student::getname(char N[])
{ strcpy(N,sname); }
void student::wrecourse(char N[],float score)
{
course *p = root;
if(p==NULL)
return;
if(p!=NULL)
p = p->Next;
while(p)
{
if(strcmp(p->cname,N)==0)
p->mark = score;
p = p->Next;
}
}
void student::addcourse (char N[],float g)
{
course *s = new course;
s->Next=NULL;
if(root == NULL)
root = s;
course *p = root;
course *newcourse = new course;
newcourse->Next = p->Next;
p->Next=newcourse;
strcpy(newcourse->cname,N);
newcourse->mark = g;
fact_course++;
}
int student::findcourse (char N[])
{
course *p = root;
if(root==NULL)
return 0;
p = p->Next;
while(p)
{
if(strcmp(p->cname,N)==0)
return 1;
p = p->Next;
}
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -