Advertisement
CMatchelo

Untitled

Dec 13th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. static void digitos(int a)
  2. {
  3. // TODO Auto-generated method stub
  4. LinkedList<Integer> stack = new LinkedList<Integer>();
  5. while (a > 0) {
  6. stack.push(a % 10);
  7. a = a / 10;
  8. }
  9.  
  10. while (!stack.isEmpty()) {
  11. System.out.print(stack.pop() + " ");
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement