ÓÅÐãѧϰ×ÊÁÏ »¶ÓÏÂÔØ
}
while(1) {
scanf(\ if(s[i].a!='!')
s[i].num=i+1; else
break; if(s[i].a>'Z')
s[i].a=s[i].a-32;
printf(\ i++; }
£¨3£©ÔÚ±¾ÊµÑéµÄʵÑéÄÚÈÝ1µÄ»ù´¡ÉÏ£¬ÊµÏÖÔÚÁ´±íÔªËØindex֮ǰ²åÈëÔªËصIJÙ×÷Insert( struct node *head, int index)ºÍɾ³ýÖ¸¶¨Î»ÖÃÔªËصIJÙ×÷Delete( struct node * head, int index)£¬²¢±àдÖ÷º¯Êý²âÊÔ¡£
#include
char name[15]; char num[15]; char risk[15];
struct student *next; };
struct student * fun() {
struct student *p,*q,*head; q=head=NULL; char str[15]={'\\0'};
printf(\ÇëÒÀ´ÎÊäÈëѧÉúµÄÐÕÃû£¬Ñ§ºÅ£¬³É¼¨£º(ÒÔ'0'×÷Ϊ½áÊø±êÖ¾)\\n\
ÓÅÐãѧϰ×ÊÁÏ »¶ÓÏÂÔØ
while(1) {
scanf(\ if(str[0]=='0') break;
p=(struct student *)malloc(sizeof(struct student)); strcpy(p->name,str); scanf(\ scanf(\ if(head==NULL) head=q=p; else {
q->next=p; q=p; } }
q->next=NULL; return head; }
struct student * park(struct student *head) {
int i;
char str[15];
struct student *p,*q;
printf(\ÄãÏëҪɾ³ýij¸öѧÉúµÄÐÅÏ¢Âð?ÊÇ/·ñ(1/0)\\n\scanf(\if(!i)
return head;
printf(\ÇëÊäÈëÄãÏëҪɾ³ýµÄѧÉúÐÕÃû\\n\scanf(\
for(p=head,q=NULL;p!=NULL;q=p,p=p->next) if(!strcmp(p->name,str)) break; if(p==NULL) {
printf(\ûÓÐÄãҪɾ³ýµÄѧÉúµÄÐÅÏ¢\\n\
return head; } else {
ÓÅÐãѧϰ×ÊÁÏ »¶ÓÏÂÔØ
if(q==NULL) head=p->next; else {
q->next=p->next; }
free(p); }
return head; }
struct student *wall(struct student *head) {
int i,j,k=1;
struct student *p,*q,*r;
printf(\ÄãÏëÒªÌí¼Óij¸öѧÉúµÄÐÅÏ¢Âð£¿ÊÇ/·ñ(1/0)\\n\scanf(\if(!i)
return head;
printf(\ÇëÊäÈëÄãÏëÒªÌí¼ÓµÄѧÉúµÄÐÅÏ¢£º£¨ÒÀ´ÎΪ£ºÐÕÃû£¬Ñ§ºÅ£¬³É
¼¨£©\\n\
p=(struct student *)malloc(sizeof(struct student)); scanf(\scanf(\scanf(\
printf(\ÇëÊäÈëÄãÏëÒªÌí¼Óµ½µÄλÖÃ\\n\scanf(\
for(q=head,r=NULL;q!=NULL;r=q,q=q->next) {
if(j==1) {
p->next=head; head=p; break; }
if(k==j) {
p->next=q; r->next=p; break;
ÓÅÐãѧϰ×ÊÁÏ »¶ÓÏÂÔØ
} k++; }
if(q==NULL&&j==k) {
q=p;
p->next=NULL; }
if(q==NULL&&j>k)
printf(\ÄãµÄÌí¼ÓµÄλÖò»ºÏ·¨\\n\
return head; }
void prin(struct student *head) {
struct student *p;
for(p=head;p!=NULL;p=p->next) {
printf(\ printf(\ printf(\ printf(\ } }
main() {
struct student *head; head=fun();
head=wall(head); head=park(head); prin(head); }
ʵÑé¾Å Îļþ²Ù×÷ ʵÑé £¨ ÑéÖ¤ÐÔ ×ÛºÏÐÔ ÊµÑé 1ѧʱ£©
ÓÅÐãѧϰ×ÊÁÏ »¶ÓÏÂÔØ
1¡¢Ä¿µÄÒªÇó£º
£¨1£©ÕÆÎÕÎļþµÄ´ò¿ªºÍ¹Ø±Õ¡£ £¨2£©¾«Í¨ÎļþµÄ¶Áд²Ù×÷¡£
£¨3£©Á˽âÎļþµÄ¶¨Î»²Ù×÷¼°ÎļþµÄ¼ì²âº¯Êý¡£ £¨4£©ÕÆÎÕÎļþµÄÓ¦Óᣠ£¨5£©±àдʵÑ鱨¸æ¡£
2¡¢ÊµÑéÄÚÈÝ£¨²Î¿¼ÊµÑéÖ¸µ¼Ê飩£º £¨1£©±àдһ¸ö³ÌÐò£¬¶ÁÈ¡´ÅÅÌÉϵÄÒ»¸öCÓïÑÔ³ÌÐòÎļþ£¬ÒªÇó¼ÓÉÏ×¢ÊͺóÔÙ´æ·Åµ½´ÅÅÌÉÏ£¬Îļþ¿ÉÒÔÁíÍâÃüÃû¡£
#include
int i=0,j;
char c,a[80]={\ FILE *p;
if((p=fopen(\ fscanf(p,\
fclose(p);
if((p=fopen(\ {
printf(\ exit(1); }
fputs(\ fprintf(p,a); fputs(\ fclose(p); }
£¨2£©±àдһ¸ö³ÌÐò£¬½«Îļþold.txt´ÓµÚ10ÐÐÆð´æ·Åµ½new.txtÖС£
#include
int i=0; char c;
FILE *p1,*p2;