当前位置:网站首页>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;
}
边栏推荐
- Input and output of cnn
- Oracle数据库体系结构
- 通关SQLilab靶场——Less-1思路步骤
- golang runtime Caller、Callers、CallersFrames、FuncForPC、Stack作用
- prometheus接入mysqld_exporter
- wait系统调用
- es6递归函数
- 无刷无霍尔BLCD电机控制
- 性能测试(03)-JDBC Request
- Solve 1. tensorflow runs using CPU but not GPU 2. GPU version number in tensorflow environment 3. Correspondence between tensorflow and cuda and cudnn versions 4. Check cuda and cudnn versions
猜你喜欢
【C language】动态数组的创建和使用
golang 三种指针类型具体类型的指针、unsafe.Pointer、uintptr作用
golang 标准库json Marshal、Unmarshal坑
Preparation for gold three silver four: how to successfully get an Ali offer (experience + interview questions + how to prepare)
Netscope: Online visualization tool for neural network structures
wpf实现简易画板功能(带截取画板,签名截图等等)
爱可可AI前沿推介(8.9)
MATLAB中如何把cftool拟合的函数输出到命令行(解决如何导出拟合后的曲线数据)
数论知识点
激光条纹中心提取——Steger
随机推荐
Open3D 点云平均点间距评估
PAT1003
grpc系列-初探grpc 路由注册和转发实现
学长告诉我,大厂MySQL都是通过SSH连接的
gdb 10.2的安装
C语言中信号函数(signal)的使用
美的数字化平台 iBUILDING 背后的技术选型
C语言数组题_校门外的树_标记法
x86异常处理与中断机制(3)中断处理过程
bit、byte、KB、M、G、T相互关系
Antdv+Asp.net WebApi开发学生信息管理系统(一)
mysql参数学习----max_allowed_packet
结构体知识点整合(前篇)
PTA 求一批整数中出现最多的个位数字
golang 标准库json Marshal、Unmarshal坑
为什么组合优先于继承
wait系统调用
Qt获取EXE可执行文件的上一级目录下的文件
caffe ---make all editing error
margin出bug---margin失效