Update ex1_11.cpp

using for loop to change the while loop, just for a test.