等级考试上机题目(上课用)(13)
时间:2026-01-17
时间:2026-01-17
p=h->next;
if (p==NULL) printf("\nThe list is NULL!\n");
else
{printf("\nHead");
do {printf("->%d",p->data); p=p->next;} while(p!=NULL);
printf("->End\n");
}
}
main()
{SLIST *head; int x;
int a[N]={11,12,15,18,19,22,25,29};
head=creatlist(a);
printf("\nThe list before inserting:\n"); outlist(head);
printf("\nEnter a number : "); scanf("%d",&x);
fun(head,x);
printf("\nThe list after inserting:\n"); outlist(head);
}
2.程序改错题
#include <stdio.h>
long fun (long num)
{
/************found************/
long k;
do
{k*=num%10 ;
/************found************/
num\=10 ;
} while(num);
return (k);
}
main()
{long n ;
printf("\nPlease enter a number:"); scanf("%ld",&n);
printf("\n%ld\n",fun(n));
}
3.程序设计题
13
下一篇:LED电子屏招标公告