Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#include <iostream>
#include "input.h"
#include "lab_age.h"
int main()
{
int age;
// get the user input and deal with invalid values
try
{
std::cout << "Enter an age: ";
age = input<int>();
}
catch( std::runtime_error &e )
{
std::cerr << e.what() << std::endl;
return 1;
}
std::cout << "You are a " << age_description(age) << std::endl;
return 0;
}