#include
#include
using namespace std;
struct Student{
long number;
float score;
Student* next=NULL;
};
Student *head=new Student;
Student *pE=head;
Student *p=head;
Student *p1=head,*p2;
Student* getNode(){
int num;
float sc;
cin >> num >> sc;
if(num == 0) {
return NULL;
}
Student* p = new Student;
p->number = num;
p->score = sc;
p->next = 0;
return p;
}
void Create() {
if((head = getNode()) == 0) {
return // 添加结束条件
;
}
for ( Student*pS=getNode() ,*p11=head; pS !=NULL; pE=pS,pS=getNode(),p=head) {
//cout<<"begincreating"<number << "," << p->score << endl;
pE->next = pS;
}
}
void ShowList() {
cout << "now the itens of list are n";
for(p->next=p1->next;p !=NULL;p=p->next ) { // 循环输出
cout<< p->number << "," << p->score << endl;
}
}
int main(){
cout << fixed << setprecision(1);
Create();
ShowList();
}