Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- // write your code here
- Scanner scan = new Scanner(System.in);
- int n;
- System.out.println("UNESITE N");
- n=scan.nextInt();
- int length=String.valueOf(n).length()-1;
- int result=0;
- while (n>0){
- int reminder=(int) (n/(Math.pow(10,length)));
- if(reminder%2==0){reminder=5;}
- result+=reminder*(int)Math.pow(10,length);
- n=n%(int) Math.pow(10,length);
- length--;
- }
- System.out.println(result+" result");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement