资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

c语言学生信息录入的函数 c语言学生信息输入输出

C语言中学生信息的录入功能

1。根据学生信息定义一个结构体类型,再说明一个该结构体类型的数组。*/

成都创新互联公司2013年开创至今,是专业互联网技术服务公司,拥有项目网站设计、网站建设网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元历下做网站,已为上家服务,为历下各地企业和个人服务,联系电话:028-86922220

struct stu_info{

char stuNo[10];/* No */

char stuName[30];/* Name */

float stuScore[3];/* the three scores */

float aveScore; /* average score */

float totalScore; /* total score */

}stu[10];

/* 2。用input函数从键盘上输入10个学生的数据。 */

void input()

{ int i = 0;

printf("Input the students' infomation(FORMAT LIKE:No Name score1 score2 score3):\n");

while(i 10)

{ printf("Input %d:",i + 1);

scanf("%s%s%f%f%f",stu[i].stuNo,stu[i].stuName,stu[i].stuScore[0],stu[i].stuScore[1],stu[i].stuScore[2]);

i++;

}

}

C语言试编写输入、输出学生信息的函数,设学生信息包括学号、姓名和5门课程的成绩。

#includestdio.h

struct{

int num;

char name[10];

int s1,s2,s3,s4,s5;

}student[1000];

int main()

{

int number,i;

printf("请输入学生总人数:");

scanf("%d",number);

for(i=0;inumber;i++){

printf("请输入第%d名学生的信息\n",i+1);

printf("学号:");

scanf("%d",student[i].num);

printf("姓名:");

scanf("%s",student[i].name);

printf("成绩一:");

scanf("%d",student[i].s1);

printf("成绩二:");

scanf("%d",student[i].s2);

printf("成绩三:");

scanf("%d",student[i].s3);

printf("成绩四:");

scanf("%d",student[i].s4);

printf("成绩五:");

scanf("%d",student[i].s5);

}

printf("学生信息如下:\n");

for(i=0;inumber;i++){

printf("学号:%3d",student[i].num);

printf("姓名:%3s",student[i].name);

printf("成绩一:%3d",student[i].s1);

printf("成绩二:%3d",student[i].s2);

printf("成绩三:%3d",student[i].s3);

printf("成绩四:%3d",student[i].s4);

printf("成绩五:%3d\n",student[i].s5);

}

return 0;

}

编写一个c语言程序,实现录入学生学号和姓名信息的功能

1、首先创建一个c语言项目。然后右键头文件,创建一个Stu的头文件。

2、然后编写头文件的代码。再将数据结构的增删改查和结构体写入头文件。

3、然后在源文件中创建main源文件和Stu源文件。再main文件中写入int mian()代码。

4、然后在mian主函数中,写入while语句无限循环。再写入Init函数。

5、然后在Stu源文件的Init函数用printf语句,将学生管理系统输出。再创建链表的头节点head。

6、然后用switch函数对操作进行判断。再执行数据结构的增删改查功能。


网站栏目:c语言学生信息录入的函数 c语言学生信息输入输出
URL链接:http://cdkjz.cn/article/dochgdi.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220