Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- class Calculadora {
- public static void main(String[] args) {
- Stack pilha = new Stack();
- int a = 120;
- int b = 2;
- int quociente = -1;
- while (quociente != 0) {
- quociente = a / b;
- int resto = a % b;
- a = quociente;
- pilha.push(resto);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement