#include
(849)#include
using namespace std;
int main(){
string str;
while(cin>>str){
for(int i=str.size()-1;i>=0;i--){
cout<<str[i];
}
cout<<endl;
}
return 0;
}
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String s = scanner.nextLine();
String s1 = new StringBuilder(s).reverse().toString();
System.out.println(s1);
}
} 当然也可以如下一行解决,但没必要 import java.util.Scanner;
public class Main02 {
public static void main(String[] args) {
System.out.println(new StringBuilder(new Scanner(System.in).nextLine()).reverse().toString());
}
}
#include<stdio.h>
#include<string.h>
int main (){//the shorter,the better.
char str[200],c;int i,n;
for(;~scanf("%s",str);)
for(n=strlen(str),i=n-1;i>=0;i?printf("%c",str[i]):printf("%c\n",str[i]),i--);
}
import java.util.*;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
char[] arr = str.toCharArray();
Stack<Character> stack = new Stack<Character>();
for (char c : arr) {
stack.push(c);
}
int len = stack.size();
for (int i = 0; i<len; i++) {
System.out.print(stack.pop());
}
}
}