Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int[] method(int value) {
- int[] vetor = new int[2];
- vetor[0] = value / 100;
- vetor[1] = value % 100;
- return vetor;
- }
- Exemplo de uso:
- int i = method(2025)[0]; // i = 20
- int j = method(2025)[1]; // j = 25
- int[] v = method(2025); // v[0] = 20, v[1] = 25
- dUtils: Existem números de 4 digitos que quando quebrados e somados² retornam o próprio número.
- 2025 = 20 + 25 = 45² = 2025.
Advertisement
Add Comment
Please, Sign In to add comment