当前位置:网站首页>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;
}
边栏推荐
猜你喜欢
随机推荐
golang源代码阅读,sync系列-Pool
Quartz分布式实现
The use of C language typedef 】 : structure, basic data types, and array
fidder为什么不会抓包的问题
Use gdb to debug multi-process programs, debug parent and child processes at the same time
fork创建多个子进程
mysql参数学习----max_allowed_packet
二叉树 前序是根在前(根左右)中序(左根右)
CentOS6.5 32bit安装Oracle-11gR2步骤说明
gdb 10.2的安装
二进制加法
Invisible OOM in kubernetes
STM32使用静态队列保存数据
Qt 国际化翻译
Open3D point cloud average point spacing evaluation
Preparation for gold three silver four: how to successfully get an Ali offer (experience + interview questions + how to prepare)
CAN总线发送数据
C语言统计不同单词数
从位图到布隆过滤器
日期工具类