#include "stdio.h"

本文介绍了C语言的基础知识,包括头文件的使用,涵盖了C语言的基本语法、输入输出操作等内容,适合初学者入门学习。
摘要由CSDN通过智能技术生成
#include "stdlib.h"
#include "stdio.h"
struct list
{ int data;
struct list *next;
};
typedef struct list node;
typedef node *link;
void main()
{ link ptr,head;
int num,i;
ptr=(link)malloc(sizeof(node));
ptr=head;
printf("please input 5 numbers==>\n");
for(i=0;i<=4;i++)
{

  


http://www.zznews.cn/hyzx/jkxx/5451672959.html
http://www.zznews.cn/hyzx/jkxx/5451688330.html
http://www.rznews.cn/yszx/stbk/5482712213.html
http://www.zznews.cn/hyzx/jkxx/5451690985.html
http://www.rznews.cn/yszx/stbk/5474988677.html
http://www.rznews.cn/yszx/stbk/5474508372.html



}scanf("%d",&num);

  ptr->data=num;
  ptr->next=(link)malloc(sizeof(node));
  if(i==4) ptr->next=NULL;
  else ptr=ptr->next;
}
ptr=head;
while(ptr!=NULL)
{ printf("The value is ==>%d\n",ptr->data);
  ptr=ptr->next;
}
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
#include #include struct DATA { int ID; char name[4]; char sex[3]; int score; }; void paixu(int*,DATA*,int); int sishewuru(double); void func1(int*,int*,DATA*,int*,int,int,int,int);//统计男女比例 int func2(int*,int,DATA*);//查找考生序号 void print(); void main() { int length=0,i,yiben,erben,sanben,dazhuan,male[4],female[4]; int yi,er,san,si; char input; FILE* file=fopen("f1.txt","r"),*file1; if(file==NULL) { printf("No such file!\n"); return; } while(EOF!=fscanf(file,"%*[^\n]\n")) length++;//自动计算考生数罝ATA* data=(DATA*)malloc(length*sizeof(DATA)); int* pai=(int*)malloc(length*sizeof(int)); rewind(file); for(i=0;i='0'&&input<='4')) { printf("非法输入,请重新输入\n请输入:"); fflush(stdin); } else break; } getchar(); switch(input) { case '0': printf("\n一类本科招生线:%d\n二类本科招生线:%d\三类本科招生线:%d\\n高职高专招生线:%d\n",yi,er,san,si); printf("是否打印为文件?(y/n):"); if(getchar()=='y') { file1=fopen("各批次录取分数线.txt","w"); fprintf(file1,"一类本科招生线:%d\n二类本科招生线:%d\\n三类本科招生线:%d\n高职高专招生线:%d\n",yi,er,san,si); fclose(file1); } fflush(stdin); break; case '1': func1(male,female,data,pai,yiben,erben,sanben,dazhuan); printf("一类本科招生线男女比例:%d:%d\n",male[0],female[0]); printf("二类本科招生线男女比例:%d:%d\n",male[1],female[1]); printf("三类本科招生线男女比例:%d:%d\n",male[2],female[2]); printf("高职高专招生线招生线男女比例:%d:%d\n",male[3],female[3]); printf("是否打印为文件?(y/n):"); if(getchar()=='y') { file1=fopen("各批次录取男女比例.txt","w"); fprintf(file1,"一类本科招生线男女比例:%d:%d\n",male[0],female[0]);
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值