Fórum Math.pow entre métodos. #566003
09/04/2009
0
Math.pow(string.charAt(2), 5);
Diogopc
Curtir tópico
+ 0Post mais votado
09/04/2009
Math.pow(Double.valueOf(string.charAt(2)).doubleValue(), 5.0);
Manuel Leiria
Gostei + 1
Mais Posts
09/04/2009
Diogopc
import java.util.*;
public class Narc {
public static void main(String[] args) {
Scanner teclado = new Scanner(System.in);
int numero = teclado.nextInt();
String s = Integer.toString(numero);
int tamanho = s.length();
double soma = 0;
for(int i = 0; i < expoente; ++i){
soma = soma + Math.pow(s.charAt(i), tamanho);
}
System.out.println(soma);
}
}Gostei + 0
09/04/2009
Vagner Planello
String s = "123";
for (int i = 0 ; i < s.length() ; i++) {
Double d = new Double(""+s.charAt(i));
System.out.println(d);
}
Gostei + 0
09/04/2009
Diogopc
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)