while (1)
{
get_next_input();
if (end_of_file)
exit_routine();
if (type=='1')
{
process1_routine();
continue;
}
else if (type=='2')
{
process2_routine();
continue;
}
else display_type_error()
}