einstein Posted April 28, 2012 at 09:07 PM Report #451955 Posted April 28, 2012 at 09:07 PM Tendo um numero inteiro como posso "apanhar" o algarismo das unidades e o das dezenas?
pmg Posted April 28, 2012 at 09:08 PM Report #451956 Posted April 28, 2012 at 09:08 PM O que tentaste? O que queres que aconteca com numeros negativos? Sugestao: usa o modulo (operador %) e a divisao inteira (operador /). What have you tried? Não respondo a dúvidas por PM A minha bola de cristal está para compor; deve ficar pronta para a semana. Torna os teus tópicos mais atractivos e legíveis usando a tag CODE para colorir o código!
einstein Posted April 28, 2012 at 09:17 PM Author Report #451957 Posted April 28, 2012 at 09:17 PM O que tentaste? O que queres que aconteca com numeros negativos? Sugestao: usa o modulo (operador %) e a divisao inteira (operador /). Pensei com strings mas nao me parece a melhor opção. So me interessa numeros positivos. Nao estou bem a perceber como posso usar esses operadores 😄
KTachyon Posted April 28, 2012 at 09:22 PM Report #451960 Posted April 28, 2012 at 09:22 PM Pista: % dá-te o resto da divisão inteira. Exemplo de utilização: a = 3 % 2; “There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.” -- Tony Hoare
einstein Posted April 28, 2012 at 09:32 PM Author Report #451963 Posted April 28, 2012 at 09:32 PM Pista: % dá-te o resto da divisão inteira. Exemplo de utilização: a = 3 % 2; certo mas vou dividir o numero por que?
KTachyon Posted April 28, 2012 at 10:03 PM Report #451972 Posted April 28, 2012 at 10:03 PM Por 10. “There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.” -- Tony Hoare
einstein Posted April 28, 2012 at 10:46 PM Author Report #451987 Posted April 28, 2012 at 10:46 PM Por 10. Obrigado
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now