//創(chuàng)建的是一個以學生學號和成績作為數據的鏈表。在此處只設立兩個節(jié)點。struct Student{?long num;?float score;?struct Student *next;}*p1,*p2;struct Student *creat(){?struct Student *head;?int n=0;?scanf("%ld,%f",&p1->num,&p1->score);?head=0;?while(p1->num!=0)?{??n=n+1;??if(n==1)???head=p1;??else???p2->next=p1;??p1=p2;??scanf("%ld,%f",&p1->num,&p1->score);?}?p2->next=0;?return(head);}問題是:\Program Files\Microsoft Visual Studio\MyProjects\zxc\123.cpp(12) : error C2065: 'scanf' : undeclared identifier
- 3 回答
- 0 關注
- 4629 瀏覽
添加回答
舉報
0/150
提交
取消