当前位置:网站首页>PAT1006
PAT1006
2022-08-09 11:09:00 【AlanLiu6】
使用了一些常用的函数,手感生疏啊
https://pintia.cn/problem-sets/994805342720868352/problems/994805514284679168
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int main()
{
int m;
string inID;
string outID;
scanf("%d",&m);
char start[10],ending[10];
for(int i = 0;i < m;i++)
{
string t;
cin >> t;
char str[2][10];
scanf("%s %s",str[0],str[1]);
// cout << str[0] << endl << str[1] << endl;
if(i == 0)// 第一个
{
inID = t;
outID = t;
strcpy(start,str[0]);
strcpy(ending,str[1]);
continue;
}
if(strcmp(str[0],start) <= 0)
{
strcpy(start,str[0]);
inID=t;
}
if(strcmp(str[1],ending) >= 0)
{
strcpy(ending,str[1]);
outID=t;
}
}
cout << inID << " " << outID << endl;
return 0;
}
边栏推荐
- 【C language】动态数组的创建和使用
- Jmeter BeanShell post processor
- MATLAB中如何把cftool拟合的函数输出到命令行(解决如何导出拟合后的曲线数据)
- fork creates multiple child processes
- Paper Sharing | ACL2022 | Argument Relation Extraction Based on Transfer Learning
- 为什么组合优先于继承
- People | How did I grow quickly from programmer to architect?
- The use of signal function (signal) in C language
- 性能测试(01)-jmeter元件-线程组、调试取样器
- ECCV 2022 Oral | CCPL: 一种通用的关联性保留损失函数实现通用风格迁移
猜你喜欢
随机推荐
matlab图像分割,从基因芯片荧光图像中提取阴性点(弱)和阳性点(强)
Julia资料收集
bit、byte、KB、M、G、T相互关系
STM32启动方式及BootLoader
enum in c language
focusablejs
依赖注入(Dependency Injection)框架是如何实现的
sublime记录
End-to-End Object Detection with Fully Convolutional Network学习笔记
fidder为什么不会抓包的问题
es6递归函数
二进制加法
Paper Sharing | ACL2022 | Argument Relation Extraction Based on Transfer Learning
学生成绩查找系统
x86异常处理与中断机制(3)中断处理过程
Cesium加载三维模型数据
fork创建多个子进程
学习阶段总结(背包问题)
[C language] creation and use of dynamic arrays
实现strcat函数