69,368
社区成员
发帖
与我相关
我的任务
分享
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
struct stud
{
char Name[20];
float Score;
struct stud*next;
};
typedef struct stud Student;
int GoonDisplay(int i);
int GoonDispaly(int i)
{
char a;
if(i==0||i%10!=0)
{
return 1;
}
printf("press \'Enter\' to go on: ");
a=getch();
if(a='\n')
{
return 1;
}
else
return 2;
}
void Display(Student*head)
{
static int i=0;
Student*p=(Student*)malloc(sizeof(Student));
if(head!=NULL)
{
p=head;
do
{
printf("%s\n",&(p->Name));
printf("%d",&(p->Score));
p=p->next;
i++;
}
while
(
(i==0||i%10!=0)&&
p->next!=NULL&&
(GoonDisplay(i)==1)
);
}
printf("No data.\n");
}
int main()
{
static Student*head=NULL;
Display(head);
return 0;
}
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
struct stud {
char Name[20];
float Score;
struct stud*next;
};
typedef struct stud Student;
int GoonDisplay(int i);
int GoonDisplay/*GoonDispaly*/(int i)
{
char a;
if (i == 0 || i % 10 != 0) {
return 1;
}
printf("press \'Enter\' to go on: ");
a = getch();
if (a == '\n') { /*mark*/
return 1;
} else
return 2;
};
void Display(Student*head)
{
static int i = 0;
Student*p = (Student*)malloc(sizeof(Student));
if (head != NULL) {
p = head;
do {
printf("%s\n", &(p->Name));
printf("%d", &(p->Score));
p = p->next;
i++;
} while
(
(i == 0 || i % 10 != 0) &&
p->next != NULL &&
(GoonDisplay(i) == 1)
);
}
printf("No data.\n");
}
int main()
{
static Student*head = NULL;
Display(head);
return 0;
}