Klokova_Sofi

n to 10

Feb 12th, 2021
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. import java.util.*;
  2. import java.util.Math;
  3.  
  4. public class Main{
  5.     public static void main(String[] args) throws Throwable{
  6.         Scanner keyboard = new Scanner(System.in);
  7.         String s = new String();
  8.         int s =  keyboard.next();
  9.         int b = s.length();
  10.         b = b - 1;
  11.         int k =  keyboard.nextInt();
  12.         char x;
  13.         int y=0;
  14.         while(s !=0) {  //эта строка перестала быть актуальной
  15.             x = s.charAt(b);
  16.             b = b - 1;
  17.             Math.pow(k,y)*x;
  18.             y=y+1;
  19.             s=s/10;
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment