Reverse Integer


Submit solution

Points: 10
Time limit: 1.0s
Memory limit: 64M

Authors:
Problem type
Allowed languages
Java 19, Java 8

Description

輸入一個五位數字,將這個數字做翻轉。

Rules

  • 輸入數字可以是正數或負數
  • 如果是負數,符號保持不變,只翻轉數字部分
  • 輸入須使用int type

記得 import.java.Scanner

Sample input & output

Input #1
12345
Output #1
54321
Input #2
-10011
Output #2
-11001
Input #3
21500
Output #3
512

Comments

There are no comments at the moment.