auto i cpp

#include <iostream>
#include <vector>

int main() {
    // Declare a vector of integers
    std::vector<int> numbers = {1, 2, 3, 4, 5};

    // Use auto to automatically deduce the type of iterator
    for (auto it = numbers.begin(); it != numbers.end(); ++it) {
        // Dereference the iterator to get the value
        int value = *it;

        // Print the value
        std::cout << value << " ";
    }

    // Output a newline
    std::cout << std::endl;

    return 0;
}