浙江大学PAT_甲级_1036. Boys vs Girls (25)

UE4打包为Framework库嵌入iOS原生工程 阅读详情

题目链接:点击打开链接

This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students.

Input Specification:

Each input file contains one test case. Each case contains a positive integer N, followed by N lines of student information. Each line contains a student's name, gender, ID and grade, separated by a space, where name and ID are strings of no more than 10 characters with no space, gender is either F (female) or M (male), and grade is an integer between 0 and 100. It is guaranteed that all the grades are distinct.

Output Specification:

For each test case, output in 3 lines. The first line gives the name and ID of the female student with the highest grade, and the second line gives that of the male student with the lowest grade. The third line gives the difference gradeF-gradeM. If one such kind of student is missing, output "Absent" in the corresponding line, and output "NA" in the third line instead.

Sample Input 1:

3
Joe M Math990112 89
Mike M CS991301 100
Mary F EE990830 95
Sample Output 1:
Mary EE990830
Joe Math990112
6
Sample Input 2:
1
Jean M AA980920 60
Sample Output 2:
Absent
Jean AA980920
NA
C++程序:

#include<iostream>
#include<string>
using namespace std;
int main()
{
	int n;//人数
	int i = 0,j=0;
	//name_gender_subject[i][0]第i个人的姓名,name_gender_subject[i][1]第i个人的性别,name_gender_subject[i][1]第i个人的ID
	string name_gender_subject[10000][3];
	int grade,max_Fgrade=0,min_Mgrade=100;// grade分数,max_Fgrade女生的最高分,min_Mgrade男生的最低分
	string F_name,M_name;//F_name最高分女生的姓名+空格+ID
	cin >> n;
	for (;i < n;i++)
	{
		cin >> name_gender_subject[i][0] >> name_gender_subject[i][1] >> name_gender_subject[i][2] >> grade;
		if (name_gender_subject[i][1] == "F")//是女生
		{
			if (grade >= max_Fgrade&&grade<=100)//记录女生里的最高分
			{
				F_name = name_gender_subject[i][0] + ' ' + name_gender_subject[i][2];
				max_Fgrade = grade;
			}
		}
		else//是男生
		{
			if (grade <= min_Mgrade&&grade>=0)//记录男生里的最低分
			{
				M_name = name_gender_subject[i][0] + ' ' + name_gender_subject[i][2];
				min_Mgrade = grade;
			}
		}
	}
	if (F_name.size() == 0)//没有女生最高分
	{
		cout << "Absent" << endl;
		cout << M_name << endl;
		cout << "NA";
	}
	if (M_name.size() == 0)
	{
		cout << F_name << endl;
		cout << "Absent" << endl;
		cout << "NA";
	}
	if (M_name.size() != 0 && F_name.size() != 0)
	{
		cout << F_name << endl;
		cout << M_name << endl;
		cout << max_Fgrade - min_Mgrade;
	}
	//system("pause");
	return 0;
}


Underactuated Robotics - 欠驱动机器人学(一)- 全驱动与欠驱动系统 根据牛顿的观点,机械系统的动力学是二阶的(其状态由位置向量 q(也称为配置向量)和速度向量以及(可能还有)时间给出。二阶控制动力系统的一般形式是:其中 u 是控制向量。定义 1.1 (欠驱动控制微分方程) 二阶控制微分方程描述如下:在状态和时间 t 中,如果所得到的映射是可射的:对于每一个,都存在一个能产生预期响应的,那么系统就是全驱动的。否则,就是欠驱动(状态在时间 t)。 阅读详情

相关推荐

通达信【雷霆尊者排序】实战指南:高胜率竞价指标解析与优化策略

本文详细解析了通达信【雷霆尊者排序】指标在集合竞价阶段的应用,提供从基础设置到实战解码的完整指南。文章重点剖析了‘雷霆’、‘使者’、‘精选’等核心信号的逻辑与共振策略,并分享了如何结合K线、市场情绪进行综合研判与风险控制,旨在帮助短线交易者提升早盘选股效率与胜率。

pear55的博客 985

【PAT甲级A1036】Boys vs Girls (25分)(c++)

1036 Boys vs Girls (25分) This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students. Input Specification: Each input file contains one test case. Each case contains a po

小庄同学的博客 216

【RViz2】导入urdf模型时报错:Could not load resource xxx,Unable to open file xxx,Error retrieving file xxx

初学ROS2,想要在RViz2中显示urdf模型。其中.urdf文件引用了外部的meshes文件夹。

qq_43557907的博客 9498

PAT甲级 1036 Boys vs Girls

GitHub - ZouJiu1/PAT: 浙江大学PAT题目解答内容浙江大学PAT题目解答内容. Contribute to ZouJiu1/PAT development by creating an account on GitHub.https://github.com/ZouJiu1/PAT

邹九的个人博客 156

sldd数据字典导出为excel

sldd导出为excel

zpfjf的博客 2250

UE5入门第二周总结:基于蓝图的国际象棋的实现

在C++的学习中,这是一个入门级别的项目。我们的目标是灵活运用蓝图的特性和强大的可视化功能,做出这一入门级项目的同时,思考如何优化并改进算法,并尽可能的用面向对象的方法实现,用蓝图中的继承和多态简化编码过程。

YoungeYang的博客 1269

[PAT甲级]1036 Boys vs Girls (25 分)(C/C++实现)

This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students. Input Specification: Each input file contains one t...

qq_38370682的博客 216

GK2302量产工具下载方法,GK2302开卡教程,GK2301LT怎么开卡方法,附GK2302开卡工具,GK2301LT量产软件下载

​每种量产软件的操作流程可能略有不同,因此必须按照要求操作。为确保安全,建议使用量产部落网下载的原版量产开卡软件。

A520091000的博客 2155

浙江大学PAT_甲级_1094. The Largest Generation (25)

题目链接:点击打开链接 A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find the generation with the largest po

~~(v_v)~~ 1240

刃边法计算MTF(ESF、LSF、PSF)

MTF调制传递函数 评价一个成像系统目前主流的办法主要有三种TV line检测,MTF检测,和SFR检测。 MTF是Modulation Transfer Function的英文简称,中文为调制传递函数。 是指调制度随空间频率变化的函数称为调制度传递函数。最开始是为了说明镜头的能力。 在各个摄像头镜头中经常采用MTF描述镜头的MTF曲线,表明镜头的能力。这些曲线是通过理想的测试环境...

weixin_30911451的博客 1万+

单片机通识之UART通信协议(如何用汇编实现)

使用汇编实现UART通信

smart_num_1的博客 1002

PAT_甲级_1001. A+B Format (20)

1001. A+B Format (20)   Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input...

~~(v_v)~~ 1172

图文教程本地部署开源扣子Coze Studio工作流并接入 Gemini 大模型(windows亲测) Coze Studio 本地部署、Gemini 模型接入、开源 AI 工具平台、大模型工作流搭建

本文介绍了在Windows系统本地部署开源AI工具平台Coze Studio并接入Google Gemini大模型的完整教程。主要内容包括:1) 环境准备要求(Docker等);2) 获取源码和配置Gemini模型(需API密钥);3) 通过Docker Compose部署服务;4) 浏览器访问验证。文章指出该平台适合私有化部署,支持智能体和工作流搭建,但也存在插件系统不完善等局限。最后提供了相关资源链接,为开发者实现本地AI解决方案提供了实用指南。

代码简单说 Vue、JAVA、PHP、Node.js 熟练运用,接口、架构、性能全搞定。 2814

浙江大学PAT_甲级_1005.1005. Spell It Right (20)

c++实现

~~(v_v)~~ 991

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

浙江大学PAT_甲级_1032. Sharing (25)

题目地址:点击打开链接 To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same suf

~~(v_v)~~ 778

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

PAT_甲级_1029. Median (25)

题目链接:点击打开链接   Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1={11, 12, 13, 14} is 12, and the median of S2={9, 10, 15, 16...

~~(v_v)~~ 746

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

浙江大学PAT_甲级_1035. Password (20)

C++

~~(v_v)~~ 736

浙江大学PAT_甲级_1081. Rational Sum (20)

题目链接:点击打开链接 Given N rational numbers in the form "numerator/denominator", you are supposed to calculate their sum. Input Specification: Each input file contains one test case. Each case sta

~~(v_v)~~ 730

浙江大学PAT_甲级_1023. Have Fun with Numbers (20)

python

~~(v_v)~~ 721

PAT_甲级_1065. A+B and C (64bit) (20)

题目链接:点击打开链接   Given three integers A, B and C in [-263, 263], you are supposed to tell whether A+B &gt; C. Input Specification: The first line of the input gives the positive number of test cases,...

~~(v_v)~~ 706

浙江大学PAT_甲级_1070. Mooncake (25)

题目链接:点击打开链接 Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the regio

~~(v_v)~~ 687

浙江大学PAT_甲级_1028. List Sorting (25)

C++

~~(v_v)~~ 678

浙江大学PAT_甲级_1019. General Palindromic Number (20)

C++ stack vector

~~(v_v)~~ 652

浙江大学PAT_甲级_1058. A+B in Hogwarts (20)

python2,C++

~~(v_v)~~ 644

浙江大学PAT_甲级_1041. Be Unique (20)

C++ map

~~(v_v)~~ 639

数据结构分类与基本类型:线性、非线性、连续与分散

从 vector 与 list 的内存差异切入,讲清逻辑结构、物理结构,以及基本数据类型与数据结构的区别。

凡人叶枫的博客 357
上一篇: 浙江大学PAT_甲级_1035. Password (20)
下一篇: 浙江大学PAT_甲级_1019. General Palindromic Number (20)
pythontojava
博客等级 码龄12年 84粉丝 140原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址