ala vida

#include <iostream>
#include <string>

// Function to calculate the length of a string
int calculateStringLength(const std::string& str) {
    return str.length();
}

// Function to reverse a string
void reverseString(std::string& str) {
    int length = str.length();
    for (int i = 0; i < length / 2; ++i) {
        std::swap(str[i], str[length - i - 1]);
    }
}

int main() {
    // Declare and initialize a string variable
    std::string inputString = "ala vida";

    // Display the original string
    std::cout << "Original String: " << inputString << std::endl;

    // Calculate and display the length of the string
    int length = calculateStringLength(inputString);
    std::cout << "Length of String: " << length << std::endl;

    // Reverse the string and display the result
    reverseString(inputString);
    std::cout << "Reversed String: " << inputString << std::endl;

    return 0;
}