Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. import java.util.Arrays;
  2.  
  3. public class Number {
  4. private static int[] num = new int [100];
  5. private static int i = 0;
  6. public Number(int a){
  7. while (a != 0){
  8. num[i] = a % 10;
  9. i++;
  10. a = a/10;
  11. }
  12. }
  13. public static void mul (num, int d){
  14. int c = 0;
  15. while (c <= i){
  16. int res = num[c] * d;
  17. if(res > 9)
  18. {
  19. num[c] = res % 10;
  20. num[c + 1] = res / 10;
  21. }
  22. else num[c] = res;
  23. }
  24. }
  25. public String toString(){
  26. Arrays.toString(num);
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement