等级考试上机题目(上课用)(16)
时间:2026-01-17
时间:2026-01-17
else
{printf("\nHead");
do {printf("->%d",p->data); p=p->next;} while(p!=NULL);
printf("->End\n");
}
}
main()
{SLIST *head;
int a[N]={11,12,15,18,19,22,25,29};
head=creatlist(a);
printf("\nOutput from head:\n"); outlist(head);
printf("\nOutput from tail: \n");
while (head->next != NULL){
fun(head);
printf("\n\n");
printf("\nOutput from head again :\n"); outlist(head);
}
}
2.程序改错题
#include <stdio.h>
/************found************/
fun (char a)
{if (*a)
{fun(a+1);
/************found************/
printf("%c" *a);
}
}
main()
{char s[10]="abcd";
printf("处理前字符串=%s\n处理后字符串=", s);
fun(s); printf("\n");
}
3.程序设计题
16
下一篇:LED电子屏招标公告