Update anagram.cpp

try this method...