you can use getline( input, fact ).

BTW, in Set() you should pass by const reference or by value ...