The question is good, 1234. The proposal is very simple. Now I will give you a few sets of data and ask you to find the people who open the door and close the door. Click the link below to open the link. It is actually the string processing of water and water, but the intensity of string is more than that. In a few days, the provincial competition will come back and write a new one. Because string will appear in any competition, stl and string functions are more popular with acmer.
[Cpp] <SPAN style = "FONT-SIZE: 18px" >#include <iostream>
# Include <string>
Using namespace std;
Int main ()
{
Int t;
Cin> t;
While (t --)
{
Int n;
Cin> n;
String id, start, end;
Cin> id> start> end;
String idstart, idend, startmin, endmax;
Idstart = id;
Idend = id;
Startmin = start;
Endmax = end;
For (int I = 1; I <n; I ++)
{
Cin> id> start> end;
If (start <startmin)
{
Startmin = start;
Idstart = id;
}
If (end> endmax)
{
Endmax = end;
Idend = id;
}
}
Cout <idstart <"<idend <endl;
}
Return 0;
} </SPAN>
# Include <iostream>
# Include <string>
Using namespace std;
Int main ()
{
Int t;
Cin> t;
While (t --)
{
Int n;
Cin> n;
String id, start, end;
Cin> id> start> end;
String idstart, idend, startmin, endmax;
Idstart = id;
Idend = id;
Startmin = start;
Endmax = end;
For (int I = 1; I <n; I ++)
{
Cin> id> start> end;
If (start <startmin)
{
Startmin = start;
Idstart = id;
}
If (end> endmax)
{
Endmax = end;
Idend = id;
}
}
Cout <idstart <"<idend <endl;
}
Return 0;
}