2009-04-30 07:46:10 UTC
So if I input
A 100
Z 200
B 54
D 123
J 123
it should output
A 100
B 54
D 123
J 123
Z 200
#include
#include
#include
#include
int main()
{
std::vector
std::vector
std::string s;
while(std::cin >> s) name.push_back(s);
double d = 0;
for(int i = 0; i < name.size(); ++i) {std::cin >> d; age.push_back(d);}
std::sort(name.begin(),name.end());
// Sort the age vector that they match the sorted string
}
Thanks