#include<stdio.h>#include<stdlib.h>#include<windows.h>#include<math.h>#define OVERFLOW 0#define OK 1//reverse the list with no extra spacetypedefstruct student
{int num;struct student *next;}node,*slist;
slist creat(int n){
slist h,p,q;int a;
h =NULL;printf("input these integers:\n");for(int i=0; i<n; i++){scanf("%d",&a);
p =(slist)malloc(sizeof(node));
p->num = a;
p->next =NULL;if(h ==NULL){
h = p;
q = p;}else{
q->next = p;
q = p;}}return h;}
slist reverse(slist p){
slist s,h_temp,q;
s = q = p->next;
h_temp = p;
p->next =NULL;//while circle before the original conditionwhile(q !=NULL){
s = q->next;
q->next = h_temp;
h_temp = q;
q = s;//return the original condition}return h_temp;}intmain(){int n;
slist h;printf("input the counts:\n");scanf("%d",&n);
h =creat(n);
h =reverse(h);while(h !=NULL){printf("%d ", h->num);
h = h->next;}return0;}