URI 1984 problem solve in c++

problem details: https://www.urionlinejudge.com.br/judge/en/problems/view/1984


Solution:


#include <iostream>
#include <cstring>

using namespace std;

int main()
{
    char num[100],temp;
    cin>>num;
    for(int i=0,j=strlen(num)-1;i< strlen(num)/2;i++,j--){
    //for(int j=1;j<=strlen(num)+1;j++){

        temp = num[i];
        num[i]=num[j];
        num[j]=temp;
      //
       // }
    }
    cout << num << endl;
    return 0;
}

Comments