View Problem

Perform different actions depending on several boolean conditions (IF .. THEN .. ELSIF .. ELSE)

DiskEdit
python
if age > 84:
print 'You are really ancient'
elif age > 30:
print 'You are middle-aged'
else:
print 'You are young'
ExpandDiskEdit
cpp C++/CLI .NET 2.0
if (age > 84) Console::WriteLine("You are really ancient");
else if (age > 30) Console::WriteLine("You are middle-aged");
else Console::WriteLine("You are young");
ExpandDiskEdit
cpp C++/CLI .NET 2.0
Console::WriteLine("You are {0}", (age > 84 ? "really ancient" : age > 30 ? "middle-aged" : "young"));
ExpandDiskEdit
cpp
std::cout << "You are " << (age > 84 ? "really ancient" : age > 30 ? "middle-aged" : "young") << std::endl;

Submit a new solution for python or cpp
There are 18 other solutions in additional languages (clojure, csharp, erlang, fantom ...)