Help me in solving STRINGREV problem

My issue

i have tried to use two pointer approach . keeping one at beginning and one at ending , if they are not equal i swapped it and made count++ and moved inside else
without swapping moved inside , i ran loop for n/2 times

My code

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n;
    cin >> n;
    string s;
    int count = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> s[i];
    }
    for (int i = 0; i < n; i++)
    {
        // cout<<s[i];
    }


    for (int i = 0, j = s[n - 1]; i < n / 2; i++, j--)
    {
        if (s[i] != s[j])
        {
            count++;
            swap(s[i], s[n - 1]);


        }

    }
    cout << count;

}

Problem Link: Reverse String Practice Coding Problem - CodeChef

@jayanth_chinnu
refer the following code

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	int n;
	cin>>n;
	string s;
	cin>>s;
	int ans=0;
	for(int i=0,j=n-1;i<j;i++,j--)
	{
	    if(s[i]!=s[j])
	    ans++;
	}
	cout<<ans;
	return 0;
}