Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class sayiyiterscevir {
- public static Scanner con = new Scanner(System.in);
- public static void main(String args[]) {
- int num = con.nextInt();
- System.out.println(PrimeSpelledBackward(num));
- }
- public static int PrimeSpelledBackward(int primenumber) {
- int newNum = 0;
- int bas = ("" + primenumber).length();
- while( primenumber != 0 ) {
- int a = primenumber%10;
- primenumber /= 10;
- bas -= 1;
- newNum += a*Math.pow(10, bas);
- }
- return newNum;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement