terça-feira, 17 de novembro de 2009

Mini-Testes

Preparação para o Mini-Teste:



1. Some numbers have an interesting characteristic: If we sum the power of 3 of each
digit we get the initial number. For example, 153 is one of those numbers, since
13+53+33 = 153.

Write a function that indicates if a number possesses or not the above characteristic.
2. Using the function created above write a program that prints all the positive numbers
bellow 1000 that verify the described characteristic.


Mini-Teste I


1.Escreva uma função que receba um número inteiro e devolva o número de dígitos
que o compõe.
2. Escreva uma função que escreva na consola o número total de dígitos dos
números que pertencem a uma tabela de inteiros recebida como parâmetro (tal como
a sua dimensão).

Solução:

1.



2.






Sem comentários:

Enviar um comentário