Print student transcripts in a chain-structured structure
#include <iostream>
using namespace std;
struct Stscore
{
std::string ID;
int math;
int 中文版;
int computer;
struct stscore* NEXT;
};
int Main ()
{
stscore first ;
First . ID = "C" ;
First . Math = the ;
First . 中文版 = - ;
First . Computer = the ;
First . Next = nullptr ;
stscore second;
second. ID = "A" ;
second. Math = the ;
second. 中文版 = the ;
second. Computer = the ;
second. Next = nullptr ;
First . Next = &second;
cout<<"Id\tmath\tenglish\tcomputer"<<Endl ;
stscore* pnode = &first;
while (pnode! = nullptr)
{
cout<<pNode->ID<<"\ T"
<<pNode-> Math << "\ T"
<<pNode-> 中文版 << "\ T"
<<pNode-> Computer
<< Endl ;
Pnode = pnode-> Next ;
}
return 0;
}
Results:
ID Math 中文版 Computer
C 80 85 83
A 75 91 88
Program ended with exit code:0
01-Print student transcripts in a chain-structured structure