Advertisement
gastaojunior

Untitled

Jul 10th, 2011
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.29 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. class Calculadora {
  4.     public static void main(String[] args) {
  5.         Stack pilha = new Stack();
  6.         int a = 120;
  7.         int b = 2;
  8.         int quociente = -1;
  9.  
  10.         while (quociente != 0) {
  11.             quociente = a / b;
  12.             int resto = a % b;
  13.             a = quociente;
  14.             pilha.push(resto);
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement