Advertisement
DimitarTsvetkov

ReverseString

Jan 29th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. package reversestring;
  2.  
  3. import java.util.Scanner;
  4.  
  5.  
  6.  
  7. public class ReverseString {
  8.  
  9. public static void main(String[] args){
  10.  
  11. Scanner sc = new Scanner(System.in);
  12.  
  13. String input = sc.nextLine();
  14.  
  15. String output = " ";
  16. String text = " ";
  17. String number = " ";
  18. char symbol = ' ';
  19.  
  20. for (int i = 0; i < input.length(); i++) {
  21.  
  22. symbol = input.charAt(input.length() - i - 1);
  23. text = String.valueOf(symbol);
  24. output += text;
  25.  
  26. }
  27.  
  28. System.out.print(output);
  29.  
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement