mystu:求一个简单的C语言程序!

时间:
诗词网小编
分享

诗词网小编

目录

1.求一个简单的C语言程序!

#include"stdio.h"typedefstruct{/*姓名,学号,班级,科目ABCD*/charname[10];}student;/*计算一个学生的总成绩*/doublecountAllScore(studentstu){returnstu.A+stu.B+stu.C+stu.D;}/*找到总分最高的学生*/intfindBestStudent(studentstu[]){inti=0,index;floatmax=stu[0].allScore;for(i=1;stu[i].allScore){max=stu[i].allScore;index=i;}intmain(){studentmystu[5];inti,请输入五个学生的信息:i<i++){printf("输入第%d个学生的姓名:输入第%d个学生的学号;i+1):mystu[i].num);输入第%d个学生的班级;",mystu[i].Class);printf(",输入第%d个学生科目A的成绩;scanf(",mystu[i].A):输入第%d个学生科目B的成绩,i+1);&mystu[i].B);输入第%d个学生科目C的成绩:%f"mystu[i].C),输入第%d个学生科目D的成绩;i+1):scanf("&mystu[i].D);mystu[i].allScore=countAllScore(mystu[i]);}j=findBestStudent(mystu),总分最高的学生信息如下;):姓名,mystu[j].name);printf(",学号;mystu[j].num);printf("班级:%s;mystu[j].Class);科目A的成绩;mystu[j].A);科目B的成绩;mystu[j].B);科目C的成绩;mystu[j].C);科目D的成绩;mystu[j].D);printf(":总的成绩;%f,

2.3,给一个数组初始化10个同学的成绩,然后从键盘输入一个成绩查 找是否在数组中

stdio.h>#include <成绩2float english;i++){printf("请输入第%d个学生的信息\n"i+1),学号;":%s"姓名;"myStu[i].Name);数学成绩,scanf(":&myStu[i].math);语文成绩;",%f":&myStu[i].chinese);英语成绩;"scanf("&myStu[i].english):n学生信息输入完毕\\n你输入的学生信息如下\printf("学号 姓名 数学成绩 语文成绩 英语成绩 3平均成绩\n"i++){printf("myStu[i].ID;myStu[i].Name;myStu[i].math;myStu[i].chinese;myStu[i].english;(myStu[i].math + myStu[i].chinese + myStu[i].english)/printf(",\,n",}return 0,};

3.C 语言 我不明白typedef Student * StuP; 和 test(&mystu); 这两句代码有什么作用?

typedefStudent*Stup;是将 student的结构体指针。

4.想要用结构体数组从控制台用printf录入20个学生的学生信息

I will go over what I learned in the day time and prepare for the tomorrow‘s classes. This is my school schedule.

5.英语作文将来式mystuday plan

No plan, no goal.As a student ,I should put study in my first place,so I wants to make a plan about studying English. In the morning, I will read English texts to improve my spoken English. In each class, I will listen to the teachers carefully and make notes. After school, I will come back home on time and do my homework at once. After supper, I will go over what I learned in the day time and prepare for the tomorrow‘s classes. This is my school schedule.

6.sql2005赋值问题

select @a ---------------------查询@a的值 ‘小王’select substring(@a,1) --------查询@a的第一个字符‘小’select count(*) from mystu where stuname like substring(@a,1)+'

7.C# 设计一个学生信息管理程序(控制台程序)

*题目:设计一个学生信息管理程序。数据需求:1、学生信息:学号、姓名、年龄、性别、出生年月、专业、班级。功能需求:1、学生信息存储2、学生信息添加(学生信息从键盘上输入)3、学生信息删除(按学号删除)4、学生信息查询(提供两种查询方式:按学号查询、按姓名查询,要求使用方法的重载实现)设计要求:至少定义4个类。1、第1个类:学生类。用于描述学生对象,一个用于创建学生对象;一个用于输出学生信息。学生管理类。用于对学生信息进行管理,一个用于添加学生信息;一个用于删除学生信息;一个用于按学号查询学生信息;一个用于按姓名查询学生信息。用户操作类。至少包含2个方法:一个用于显示用户菜单;一个用于根据用户选择调用学生管理类中相应方法执行相应操作。系统菜单如下:1、添加学生信息 2、删除学生信息 3、查询学生人数 4、查询学生信息(按学号) 5、查询学生信息(按姓名) 请选择您要进行的操作(1~5):4、第4个类:应用类(主函数所在的类)。在主函数中调用第3个类中的方法进行学生管理。using System.Text;Sage,学生管理类 { public static List<public static int Count { get { return Students.Count;请输入要添加的学生信息:\n请输入学号:n请输入姓名:n请输入年龄:n请输入性别:\n请输入生日:myStudent.Sbirth = DateTime.Parse(Console.ReadLine());n请输入专业:myStudent.Sdept = Console.ReadLine();\n请输入班级:");myStudent.Sclass = int.Parse(Console.ReadLine());学生的信息是:学号:n姓名;{0}":n年龄;\,n性别;{0}"n生日,\:n系别;\n班级:{0}"Students.Count:= null) { Students.Add(myStudent);你所输入的信息有误;请核对后重新输入!);} public void Delete(int Sno) { Student Stu = Search(Sno);= null) { Students.Remove(Stu);已经删除学号为{0}的学生",Sno)!我们现在还有{0}名学生信息"Students.Count);} else Console.WriteLine("!未找到你要删除的学生;请核对后重新输入;"查询到学生的总人数为{0}"Students.Count);stuList = new List<for (int i;Students.Count;i++) { if (Students[i].Sname == Sname) { stuList.Add(Students[i]);用户操作类 { public void Check() { do { Console.WriteLine ("请选择所要操作的种类:\n1、添加学生信息 \n2、删除学生信息 \n3、查询学生人数 \n4、查询学生信息(按学号) \n5、查询学生信息(按姓名)"你的输入有误,请核对后重新输入"myStumanage.ADD(stu);请输入你要删除的学生信息:请输入学生的学号:");Sno = int.Parse(Console.ReadLine());stu = myStumanage.Search(Sno);myStumanage.ShowStuInfo(stu);break;请输入你要查询的学生信息:");Console.WriteLine(&q请输入学生的姓名:"string Sname = Console.ReadLine();(y/n)"if (Console.ReadLine()!}} class Test//应用类 { public static void Main(string[] args) { Operate myOperate = new Operate();myOperate.Check();}}}
494092

微信扫码分享