pta-乙级 1028 人口普查 (测试点3、4)

PTA题L1-033 出生年 (15分) 以上是新浪微博中一奇葩贴:“我出生于1988年,直到25岁才遇到4个数字都不相同的年份。”也就是说,直到2013年才达到“4个数字都不相同”的要求。本题请你根据要求,自动填充“我出生于y年,直到x岁才遇到n个数字都不相同的年份”这句话。 输入格式: 输入在一行中给出出生年份y和目标年份中不同数字的个数n,其中y在[1, 3000]之间,n可以是2、或3、或4。注意不足4位的年份要在前面补零,例如... 阅读详情

PTA-乙级 1028 人口普查 (测试点3、4)

某城镇进行人口普查,得到了全体居民的生日。现请你写个程序,找出镇上最年长和最年轻的人。

这里确保每个输入的日期都是合法的,但不一定是合理的——假设已知镇上没有超过 200 岁的老人,而今天是 2014 年 9 月 6 日,所以超过 200 岁的生日和未出生的生日都是不合理的,应该被过滤掉。

输入格式:

输入在第一行给出正整数 N,取值在(0,105];随后 N 行,每行给出 1 个人的姓名(由不超过 5 个英文字母组成的字符串)、以及按 yyyy/mm/dd(即年/月/日)格式给出的生日。题目保证最年长和最年轻的人没有并列。

输出格式:

在一行中顺序输出有效生日的个数、最年长人和最年轻人的姓名,其间以空格分隔。

输入样例:

5
John 2001/05/12
Tom 1814/09/06
Ann 2121/01/30
James 1814/09/05
Steve 1967/11/20

输出样例:

3 Tom John

注意点:

(1)当合理的年龄为0时,只输出num,不加空格;(测试点3)

(2)yyyy/mm/dd可以存为 string类型直接比较,如果存为 int 类型来计算比较年龄,可能会导致测试点4超时。

代码:

#include<iostream>
using namespace std;
struct person{
	string name;
	string age;
}per[100005];
int main(){
	int n;
	cin>>n;
	int num=n;
	string now="2014/09/06";
	string past="1814/09/06";
	string o_age="2222/02/02";
	string y_age="1818/08/08";
	string y_name,o_name;
	for(int i=0; i<n; i++){
		cin>>per[i].name>>per[i].age;
		if(per[i].age>now || per[i].age<past){
			num--;
		}
		else{
			if(per[i].age<o_age){
				o_age=per[i].age;
				o_name=per[i].name;
			}
			if(per[i].age>y_age){
				y_age=per[i].age;
				y_name=per[i].name;
			}
		}
	}
	if(num!=0){
		cout<<num<<' '<<o_name<<' '<<y_name<<endl;
	} 
	else{
		cout<<num<<endl;
	}	
}
PAT乙级1028人口普查 测试点3、4解决 ** 题目如下: 某城镇进行人口普查,得到了全体居民的生日。现请你写个程序,找出镇上最年长和最年轻的人。 这里确保每个输入的日期都是合法的,但不一定是合理的——假设已知镇上没有超过 200 岁的老人,而今天是 2014 年 9 月 6 日,所以超过 200 岁的生日和未出生的生日都是不合理的,应该被过滤掉。 输入格式: 输入在第一行给出正整数 N,取值在(0,10​5​​];随后 N 行,每行给... 阅读详情

相关推荐

NXP(imx8qxp)系列DDR校准以及android镜像烧录

文章目录一、 不得不吐槽以下nxp的这个代码镜像烧写的过程,做得太开源了,导致镜像根本烧录不进去,实属令人头痛。 一、

永不秃头的程序员的博客 5991

1028 人口普查 (20分)

某城镇进行人口普查,得到了全体居民的生日。现请你写个程序,找出镇上最年长和最年轻的人。 这里确保每个输入的日期都是合法的,但不一定是合理的——假设已知镇上没有超过 200 岁的老人,而今天是 2014 年 9 月 6 日,所以超过 200 岁的生日和未出生的生日都是不合理的,应该被过滤掉。 输入格式: 输入在第一行给出正整数 N,取值在(0,10^​5​​ ];随后 N 行,每行给出 1 个人的姓名(由不超过 5 个英文字母组成的字符串)、以及按 yyyy/mm/dd(即年/月/日)格式给出的生日。题目保证

一只小菜鸡 411

新手必看!无人机定高PID调参避坑指南:从理论到实战的完整流程

本文为无人机新手提供定高PID调参的完整指南,从传感器融合到抗风策略,详细解析多传感器融合、PID控制参数调试及环境干扰应对。通过实战案例和代码示例,帮助开发者快速掌握无人机定高技术,避免常见调参陷阱,提升飞行稳定性。

spark7igniter的博客 221

1028 人口普查 (20 分)测试点4答案错误 求解

#include<stdio.h> typedef struct node { char name[6]; int year; int month; int day; }man; int main() { int n; scanf("%d",&n); int t=0; man a[n];man b[n]; for(int i=0;i<n;i++) { scanf("%s %d/%d/%d",&a[i].name,&a[i]...

wowandzoz的博客 328

Android开发必备:TBS腾讯浏览服务静态集成完整指南(附Demo下载)

本文详细解析了Android开发中TBS腾讯浏览服务的静态集成方案,通过对比动态集成,深入剖析了其核心原理与适用场景。文章提供了从环境准备、资源获取、项目配置到代码初始化的完整指南,并重点介绍了WebView与文件预览等高级特性的实战应用。针对集成过程中的常见问题,提供了详尽的排查清单与性能调优建议,旨在帮助开发者构建极致稳定、不依赖网络的WebView与文件预览功能。文末附有经过验证的Demo项目可供下载参考。

earth的博客 366

Mamba再封神!与YOLO结合,拿下二区!好发不卷!

相比传统的YOLO改进,Mamba是新技术,两者结合尚在蓝海阶段,可发挥空间大!更为关键的是,它在检测精度和速度方面,都让以往的YOLO模型难以望其项背!比如代表模型Mamba YOLO,便在参数减少45.5%、FLOPs减少50%的同时,精度还比YOLOv8高6.1%!这主要得益于,Mamba能够捕捉长期依赖关系,而YOLO则擅长捕捉局部特征,两者能够优势互补,且Mamba线性复杂度的特性,也有利于提高计算效率!为了让大家能够紧跟前沿发展,找到更多灵感启发,我给大家10种。

2401_88190197的博客 2506

PAT (Basic Level) Practice (中文)1028 人口普查

题目测试点4格式错误,合法的身份证为0,后面不能有空格,最大最小年龄也不用输出。 测试点5运行超时,还是一样用sys.stdin.readline替换input

小小魔姬 687

汇川EASY系列之以太网通讯(MODBUS_TCP做主站)

汇川Easy系列以太网通讯中(MODBUSTCP,plc做主站),终于可以不用使用指令就可以完成了,全程通过简单的配置就可通讯。本文将通过EASY系列PLC与调试助手之间完成此操作。

这是一个长期关注工控行业技术的博客,实现0-1的突破,期待您的关注和留言 3303

PTA 乙级1028 人口普查 (20 分)测试点 3

1028 人口普查 (20 分 ) 某城镇进行人口普查,得到了全体居民的生日。现请你写个程序,找出镇上最年长和最年轻的人。 这里确保每个输入的日期都是合法的,但不一定是合理的——假设已知镇上没有超过 200 岁的老人,而今天是 2014 年 9 月 6 日,所以超过 200 岁的生日和未出生的生日都是不合理的,应该被过滤掉。 输入格式: 输入在第一行给出正整数 N,取值在(0,10 ​5 ​​ ]...

一蓑烟雨任平生 575

ICT调试技巧:从基础到实战的全面指南

本文提供了一份全面的ICT调试技巧指南,涵盖从基础认知到实战应用的全过程。详细解析了ICT设备硬件结构、程序文件构成,并重点讲解了调试界面的核心参数与高效快捷键。通过跳线、电阻、电容及二极管等常见元器件的实战调试案例,分享了参数设置要点与典型问题解决方案,帮助工程师快速掌握ICT调试核心技能,提升测试效率与准确性。

weixin_29202213的博客 342

人工蜂鸟算法(AHA)详解:原理、实现与应用

人工蜂鸟算法(AHA)是一种受蜂鸟飞行技能和觅食策略启发的新型元启发式优化算法。该算法模拟蜂鸟的全向飞行、记忆能力和觅食行为,通过引导觅食、领地觅食和迁徙觅食三种策略在解空间高效搜索。AHA将优化问题解类比为食物源,蜂鸟作为搜索代理,利用访问表记录访问信息。算法核心包括三种飞行技能建模(全向、对角线和轴向飞行)以及对应的数学公式实现。Python实现展示了种群初始化、适应度计算和觅食行为模拟等关键步骤。AHA以其高效的全局搜索能力、良好收敛性和鲁棒性,在复杂优化问题中表现优异。

qq_42212808的博客 905

(Python3)PTA乙1028人口普查(最后一个测试点超时)

n = int(input()) Max = '1814/09/06' Min = '2014/09/06' max_, min_, num = '2014/09/06', '1814/09/06', 0 max_name, min_name = '', '' for i in range(n): name, date = input().split() if date >=...

wy 1572

2025届程序技术类笔试题

希尔排序在直接插入排序的基础上进行了改进,它通过比较相距一定间隔的元素来进行,各轮比较所用的距离随着算法的进行而减小,直到只比较相邻元素的最后一轮排序为止。某人逆着水流的方向向岸边划船,每次行进前进x米后需要休息一下,休息期间船会自行倒退y米,每次休息后再次行进,前进距离缩短1/5,若起始距离岸边为m米,问:能否到达岸上,需要行进多少次才能上岸。直接插入排序的原理是将第i个元素插入前面i-1个已排好序的记录中,将比第i个元素大的记录依次向后移动一个位置,将第i个元素插入空位。第二轮相邻比较,后移2次。

博客 595

PTA 1028 人口普查 (20 分)【测试点3、4】求解

PTA 1028 人口普查 (20 分)【测试点3、4】求解

weixin_62553051的博客 285

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

PTA乙级-1028 人口普查 c++

文章目录题目内容输入格式:输出格式:输入样例:输出样例:一、题解要点二、具体实现总结 题目内容 某城镇进行人口普查,得到了全体居民的生日。现请你写个程序,找出镇上最年长和最年轻的人。 这里确保每个输入的日期都是合法的,但不一定是合理的——假设已知镇上没有超过 200 岁的老人,而今天是 2014 年 9 月 6 日,所以超过 200 岁的生日和未出生的生日都是不合理的,应该被过滤掉。 输入格式: 输入在第一行给出正整数 N,取值在(0,105];随后 N 行,每行给出 1 个人的姓名(由不超过 5 个英文字

weixin_44884298的博客 254

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

PAT 乙级-1028(测试点3、4)

测试点3: 有效数据可能为0,此时正确的输出为0(注意不要输出多余的空格) 测试点4: 这个测试点主要卡最大年纪,注意自己的判断逻辑是否正确(详见注释), 给出几个不合法的测试用例: 测试用例一:输出为0(age=201) 1 xiaohao 1814/5/12 测试用例二:输出为0(age=201) 1 xiaohao 1814/9/2 正确代码: #include<iostream> #include<vector> #include<algo...

学习笔记,不喜勿喷! 431

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

小白成长记之PTA乙级题 1028

PTA乙级题 1028. 人口普查(20) 【题目链接】 #include int hege (int ,int ,int ); int main() { int i,n,x=0; scanf("%d",&n); char name[n][7]; int year[n],month[n],day[n],maxy=1000,maxm=0,maxd=0,max,

JZK-Keven 的博客 413

PTA乙级1028 人口普查 (20 分)及测试点0和3分析

思路 一个个对比得出年龄大小 容易错的几个点: 测试点0:如果开局无min,max都指向定义结构体的第一个并比较,那么如果第一个数据不是合法数据,则min和max一直没变过,所以这里采用多一个循环来取到第一个合法数据,并将min和max都取值为该数据下标 测试点3:如果一个合法数据都没有,只需要输出0,且最后结尾不能有空格 代码 #include<string> using namespace std; typedef struct people{ char name[6]; i

qq_46439207的博客 601

PAT (Basic Level) Practice 1028

1028 人口普查 (20分) 题目粘过来格式不对就不写题目了,自行查看浙大PTA乙级1028,以后会用Latex后再补充回来题目。 本题属于简单查找类型,我采用C++编译器,版本是g++ 6.5.0 题解按照惯例提供两种方法并分析。 题解一 #include <cstdio> struct{ char name[6]; int year_mon_day; }temp,old,young; // 好理解,结构保存名字和时间,因为时间是8位数字,直接用

DevXU的博客 295

1028 人口普查(PTA 乙级)(C++版,纯自写)

这题考虑到所谓的年长和年轻,要通过一个按照年月日的分级排序完成(年份越小的排前面,年份相同则月份越小的排前面…所以使用sort函数,通过自定义排序函数为分级排序来达到目标。

w_jxddehhh的博客 298

PTA乙级题 人口普查 (第三个点格式错误?????)

  某城镇进行人口普查,得到了全体居民的生日。现请你写个程序,找出镇上最年长和最年轻的人。 这里确保每个输入的日期都是合法的,但不一定是合理的——假设已知镇上没有超过 200 岁的老人,而今天是 2014 年 9 月 6 日,所以超过 200 岁的生日和未出生的生日都是不合理的,应该被过滤掉。 输入格式: 输入在第一行给出正整数 N,取值在(0,10​5​​];随后 N 行,每行给出 1 ...

red_red_red的博客 347

PAT(Basic)乙级---【简单版】1028(20 分) 人口普查

某城镇进行人口普查,得到了全体居民的生日。现请你写个程序,找出镇上最年长和最年轻的人。 这里确保每个输入的日期都是合法的,但不一定是合理的——假设已知镇上没有超过 200 岁的老人,而今天是 2014 年 9 月 6 日,所以超过 200 岁的生日和未出生的生日都是不合理的,应该被过滤掉。 输入格式: 输入在第一行给出正整数 N,取值在(0,10​5​​];随后 N 行,每行给出 1 个人的...

啸天的博客 259

1028. 人口普查(20)(Java 16/20测试点4超时 -_-!)

某城镇进行人口普查,得到了全体居民的生日。现请你写个程序,找出镇上最年长和最年轻的人。这里确保每个输入的日期都是合法的,但不一定是合理的——假设已知镇上没有超过200岁的老人,而今天是2014年9月6日,所以超过200岁的生日和未出生的生日都是不合理的,应该被过滤掉。输入格式:输入在第一行给出正整数N,取值在(0, 105];随后N行,每行给出1个人的姓名(由不超过5个英文字母组成的字符串)、...

Brant985的博客 986

PAT 1028 人口普查 (20 分)

某城镇进行人口普查,得到了全体居民的生日。现请你写个程序,找出镇上最年长和最年轻的人。 这里确保每个输入的日期都是合法的,但不一定是合理的——假设已知镇上没有超过 200 岁的老人,而今天是 2014 年 9 月 6 日,所以超过 200 岁的生日和未出生的生日都是不合理的,应该被过滤掉。 输入格式: 输入在第一行给出正整数 N,取值在(0,10 ​5 ​​ ];随后 N 行,每行给出 1 个人的...

(ง •_•)ง没有困难的工作,只有勇敢的狗狗 260

PTA1028 人口普查 (20 分)

//测试点3,合理的年龄为0时,不加空格 //测试点4,比较年龄时,可能会导致超时,将数据存储为string类型直接比较 //测试点2测边界值的又出了问题,不晓得。。。 #include<stdio.h> #define N 100000 struct people { char name[6]; int year; int month; int day; }; void swap(struct people *a,struct people *b); void.

糖糖的博客 367

PAT (Basic Level) Practice 1028 人口普查 (20分)

该版本测试点4容易超时,建议对于10^5以上的数据,将cin换成scanf 如果是多输出,则将cout 换成 printf pat的好多题,如果是0,也需要输出0 #include <iostream> #include <string> #include <algorithm> #include <vector> using namespace std; struct peo { string Name; string Birth; }; b

Super_Bb 257
上一篇: PTA-乙级 1027 打印沙漏(测试点1、3、4)
下一篇: PTA-乙级 1077 互评成绩计算(四舍五入)
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值