#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
int main()
{
std::vector<double> array;
double number;
std::string value;
double summ;
summ = 0;
while (std::cin >> number >> value)
{
if (value == "cm")
{
array.push_back(number);
}
else if (value == "m")
{
array.push_back(number / 100);
}
else if (value == "in")
{
array.push_back(number / 2.54);
}
else if (value == "ft")
{
array.push_back(number / 2.54 * 12);
}
else
{
std::cout << "The value is invalid.";
}
std::sort(array.begin(), array.end());
for (int i = 0; i < array.size(); i++)
{
if (i != 0 && i != (array.size() - 1))
{
summ += array[i];
}
std::cout << array[i] << "\t";
}
std::cout << std::endl << "The summ is: " << summ << " centimeters." << std::endl
<< "The size of array is: " << array.size() << std::endl
<< "The smallest number is: " << array[0] << std::endl
<< "The biggest bumber is " << array[array.size() - 1] << std::endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8c3RyaW5nPgoKaW50IG1haW4oKQp7CgoJc3RkOjp2ZWN0b3I8ZG91YmxlPiBhcnJheTsKCglkb3VibGUgbnVtYmVyOwoJc3RkOjpzdHJpbmcgdmFsdWU7Cglkb3VibGUgc3VtbTsKCXN1bW0gPSAwOwoKCXdoaWxlIChzdGQ6OmNpbiA+PiBudW1iZXIgPj4gdmFsdWUpCgl7CgkJaWYgKHZhbHVlID09ICJjbSIpCgkJewoJCQlhcnJheS5wdXNoX2JhY2sobnVtYmVyKTsKCQl9CgkJZWxzZSBpZiAodmFsdWUgPT0gIm0iKQoJCXsKCQkJYXJyYXkucHVzaF9iYWNrKG51bWJlciAvIDEwMCk7CgkJfQoJCWVsc2UgaWYgKHZhbHVlID09ICJpbiIpCgkJewoJCQlhcnJheS5wdXNoX2JhY2sobnVtYmVyIC8gMi41NCk7CgkJfQoJCWVsc2UgaWYgKHZhbHVlID09ICJmdCIpCgkJewoJCQlhcnJheS5wdXNoX2JhY2sobnVtYmVyIC8gMi41NCAqID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