View Code of Problem 52

#include<bits/stdc++.h>
using namespace std;
#define ma 102
int main(){
	char a[ma];
	gets(a);
	int i = 0;
	int n = strlen(a)-1;
	char c;
	while(i<n){
		c = a[i];
		a[i] = a[n];
		a[n] = c;
		i++;
		n--;
	}
	puts(a);
//	for(int i = n -1;i>=0;i--)printf("%c",a[i]);
	
	return 0;
}

Double click to view unformatted code.


Back to problem 52