Vector program and time complexity


How this program get time complexity is O(1)!!! I don’t get it because it has a loop to iterate for taking input and getting output so can anyone please tell me that?