#include <iostream>
#include <string>

int main() {
    std::string a = "adarsh";
    std::string b ;
    
    std::getline(std::cin, b);
    
    int len = b.length();
    std::cout<<len<<std::endl;
    
    for(int i=0;i<len/2;i++){
        char tmp = b[i];
        b[i] = b[len-i-1];
        b[len-i-1] = tmp;
    }
    
    std::cout<<"after reverse :"<<b;
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: