这个作业属于哪个课程 C语言程序设计2
这个作业要求在哪里 https://edu.cnblogs.com/campus/zswxy/software-engineering-class2-2018/homework/3124
我的课程目标 运用结构
这个作业在哪个具体方面帮助我实现目标 运用结构解决问题
参考文献 C语言程序设计 P218-231

第一题

按等级统计学生成绩 (20 分)

代码

nt set_grade( struct student *p, int n )
{
int count=0;
for (int i=0;i<n;i++)
{
if(p[i].score>=85&&p[i].score<=100)
p[i].grade='A';
if(p[i].score>=70&&p[i].score<85)
p[i].grade='B';
if(p[i].score>=60&&p[i].score<70)
p[i].grade='C';
if(p[i].score<60){
count++;
p[i].grade='D';
}
}
return count;
}

第二题

一帮一 (15 分)

代码

#include<stdio.h>
struct student
{
int nannu;
char name[10];
}; int main()
{
int i,n,h;
scanf("%d",&n);
struct student a[n];
for(i=0;i<n;i++)
scanf("%d%s",&a[i].nannu,a[i].name);
for(i=0;i<n/2;i++)
{
for(h=n-1;h>=n/2;h--)
{
if(a[i].nannu!=a[h].nannu&&a[h].nannu!=2)
{
printf("%s %s\n",a[i].name,a[h].name);
a[h].nannu=2;
break;
}
}
}
return 0;
}

第三题

考试座位号 (15 分)

代码

#include<stdio.h>
struct student{
char n[1000];
int a;
int b;
};
int main()
{
int N;
struct student man[1000];
scanf ("%d",&N);
for (int i=0; i<N; i++){
scanf ("%s%d%d",&man[i].n,&man[i].a,&man[i].b);
}
int M;
scanf("%d",&M);
for(int i = 0; i<M; i++){
int x;
scanf("%d",&x);
for(int i = 0; i<N; i++){
if (man[i].a==x){
printf("%s %d\n",man[i].n, man[i].b);
}
}
}
return 0;
}

问题

不会用动态写此题

周/日期 这周所花时间 代码行数 学到知识点 目前比较迷惑的问题
4/15-4/19 6 hours 73 结构 结构的运用

5学习感悟

这次的作业很难,通过看书和百度能学到更多的东西

六、结对编程感想

两个臭皮匠赛过诸葛亮

PTA9的更多相关文章

  1. k60引脚图

    /*! 枚举管脚编号 */ typedef enum { /* PTA端口 */ //0~31 PTA0, PTA1, PTA2, PTA3, PTA4, PTA5, PTA6, PTA7, PTA8 ...

随机推荐

  1. [BZOJ3167]Sao

    Problem 给你n个任务,n-1个关系,ab代表a在b前或者a在b后 问你有几种拓扑序 Solution f[i][j]表示第i个节点前有j个节点的方案数 设当前节点为x,儿子节点为s,若x依赖于 ...

  2. canal-client无法获取数据

    在虚拟机单cpu环境下 canal.properties配置中 #canal.instance.parser.parallelThreadSize = 16 那么,MysqlMultiStageCop ...

  3. [Oracle][RMAN] Use RMAN to Migrate database from CentOS_5-11201-SingleDB to OracleLinux_5-11204-SingleDB

    リンク:How to Move/Restore DB to New Host and File System using RMAN (Doc ID 1338193.1)https://docs.ora ...

  4. Git 转载

    我每天使用 Git ,但是很多命令记不住. 一般来说,日常使用只要记住下图6个命令,就可以了.但是熟练使用,恐怕要记住60-100个命令. 下面是我整理的常用 Git 命令清单.几个专用名词的译名如下 ...

  5. Python之字符串方法

    def capitalize(self): # 第一个字符变大写 def center(self, width, fillchar=None): # 内容居中,两端可指定内容填充 def count( ...

  6. BluePrism初尝

    由于对工作的需求,现在开始接触了RPA. RPA是什么?第一次看见这个名词,我脑海里只有RPG的概念.一番查询,才知道是Robotic Process Automation的英文缩写,机器人流程自动化 ...

  7. input.nextLine()的注意事项

    若在input.nextInt()和input.nextDouble()后使用input.nextLine(),要先加一个input.nextLine()进行换行

  8. Delphi编程之爬取贴吧帖子图片

    大家如果经常在逛贴吧的时候,会看到很多帖子里有很多好看的图片,都想下载下来留存的话,常规的方法只能一张一张点击右键,然后图片另存为,这样的方法对于图片少的来说没什么,要是图片超过100张,200张,那 ...

  9. SpringBoot的学习【5.Spring Boot 的配置文件】

    1.配置文件的名称 Spring Boot 会将两种名称的文件默认为项目的全局配置文件.配置文件的名字是固定的. application.properties application.yml 2.配置 ...

  10. soapUI的安装及破解

    1.下载安装包 SoapUI SoapUI-Pro-x64-5.1.2.exe Protection-4.6.jar scz.key 2.安装SoapUI-Pro-x64-5.1.2.exe 3.拷贝 ...