#include <iostream>
using namespace std;

void rev_str(char *s1, char *s2);
void rev_str(char *s1);

int main(){
	char s1[80], s2[80];
	strcpy(s1, "abcd");
	rev_str(s1, s2);
	rev_str(s1);
	
	cout << s1 << "\n";
	cout << s2 << "\n";

	return 0;
}

void rev_str(char *s1, char *s2)
{
	int len = strlen(s1);
	for (int i = 0; i < len; i++){
		s2[len - i - 1] = s1[i];
	}
	s2[len] = '\0';
}
void rev_str(char *s1)
{
	int len = strlen(s1);
	for (int i = 0; i < len / 2 ; i++){
		char cforswap = s1[len - i - 1];
		s1[len - i - 1] = s1[i];
		s1[i] = cforswap;
	}
}
