character reverse order
Time Limit: 1s Memory Limit: 64MB Committed: 38979 Solved: 21375
topic description
Reverse the contents of a string str and output it. The length of str does not exceed 100 characters.
input format
Input consists of one line. The string entered on the first line.
output format
Output the converted string in reverse order.
sample input
I am a student
sample output
tneduts a ma I
#include<bits/stdc++.h>
using namespace std;
char a[105];
int main() {
gets(a);
for(int i=strlen(a)-1;i>=0;i--){
printf("%c",a[i]);
}
return 0;
}