fork download
  1. public class Solution {
  2. double calc(double x, long n)
  3. {
  4. if (n == 1) return x;
  5. else
  6. {
  7. if (n % 2 == 0)
  8. {
  9. double res = calc(x, n / 2);
  10. return res * res;
  11. }
  12. else
  13. {
  14. double res = calc(x, (n - 1) / 2);
  15. return x * res * res;
  16. }
  17. }
  18. }
  19. public double MyPow(double x, int N) {
  20. long n = N;
  21. if (n == 0)
  22. return 1;
  23. else if (n > 0)
  24. return calc(x, n);
  25. else
  26. return 1 / calc(x, n * -1);
  27. }
  28. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.100

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Package source with Name: nuget.org disabled successfully.
Package source with Name: local added successfully.
CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/home/xOo9ut/Project/Project.csproj]



CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/home/xOo9ut/Project/Project.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:05.07
stdout
Standard output is empty