[데이터 구조 상의 작업] 일부 학생 들 의 성적 (적어도 학생 번호, 성명, 과정 성적 포함) 을 입력 하고 단일 체인 표 로 저장 하 며 평균 성적 보다 큰 학생 정 보 를 출력 합 니 다.
#include
#include
#include
#include
#include
using namespace std;
struct link *AddNode(struct link *head);
void ShowNode(struct link*head);
void DeleteMemory(struct link *head);
void ShowYouSheng(struct link *head);
struct link *DeleteNode(struct link *head, char NodeDate[100]);
struct link *InsertNode(struct link *head);
struct link
{
int grade;
char name[100];
char stunum[100];
struct link *next;
};
int main()
{
char c;
int i = 0;
struct link *head = NULL;
cout<c;
while(c == 'Y')
{
head = AddNode(head);
//ShowNode(head);
cout<c;
i ++;
}
cout< 1, ->2, ->3; ->0"<>b;
if(b == 3)
{
;
}
else if(b == 2)
{
cout<Deletestunum;
DeleteNode(head,Deletestunum);
cout<next;
}
pr->next = p;
}
cout<name >>stunum >>grade;
p->name = name;
p->stunum = stunum;
p->grade = grade;*/
cin>>p->name;
cin>>p->stunum;
cin>>p->grade;
p->next = NULL;
return head;
}
void ShowNode(struct link *head)
{
struct link *p = head;
int j = 1;
while (p != NULL)
{
coutnext;
free(pr);
}
}
void ShowYouSheng(struct link *head)
{
struct link *p = head,*p2 = head;
int sum=0,o=0;
double averagesum;
while(p != NULL)
{
sum=sum+(p->grade);
o ++;
p = p->next;
//cout averagesum)
{
cout<next != NULL)
{
pr = p;
p = p->next;
}
if(strcmp(NodeDate,p->stunum) == 0)
{
if(p == head)
{
head = p->next;
}
else
{
pr->next = p->next;
}
free(p);
}
else
{
cout<next;
}
pr->next = p;
}
cout<p->name;
cin>>p->stunum;
cin>>p->grade;
p->next = NULL;
return head;
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.