fork download
  1. using System;
  2.  
  3. class Programa
  4. {
  5. static void Main()
  6. {
  7. double resultado = Potencia(13, 2) * Raiz(25) - (Potencia(4, 3) + Raiz(144) + (Potencia(3, 5) - Potencia(2, 7)));
  8. Console.WriteLine(resultado);
  9. }
  10.  
  11. static double Potencia(double baseNum, int exponente)
  12. {
  13. double resultado = 1;
  14. for (int i = 0; i < exponente; i++)
  15. {
  16. resultado *= baseNum;
  17. }
  18. return resultado;
  19. }
  20.  
  21. static double Raiz(double numero)
  22. {
  23. double aproximacion = numero / 2;
  24. for (int i = 0; i < 10; i++)
  25. {
  26. aproximacion = (aproximacion + numero / aproximacion) / 2;
  27. }
  28. return aproximacion;
  29. }
  30. }
  31.  
Success #stdin #stdout 0.07s 28132KB
stdin
Standard input is empty
stdout
654