⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 120.c

📁 C语言算法举例.rar
💻 C
字号:
#define   NULL  0

#define   LEN     sizeof(struct grade)
struct  grade
   { char  no[7];				
      int  score;				
      struct  grade  *next;			
    };
struct grade *create( void )
    { struct grade *head=NULL, *new, *tail;
        int count=0;             		
        for(  ;   ;  )              		
     	  { new=(struct grade *)malloc(LEN);	

printf("Input the number of student No.%d(6 bytes): ", count+1);
scanf("%6s", new->no);
if(strcmp(new->no,"000000")==0)    
      { free(new);              	      	
         break;                    	      	       }
printf("Input the score of the student No.%d: ", count+1);
scanf("%d", &new->score);
count++;                     		
new->next=NULL;

if(count==1)  head=new;  
      else  tail->next=new;       
       tail=new;                         
     }
   return(head);
}						



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -