What is the sum of the digits of the decimal form of the number represented by brain teaser 21/10/2024 ![]() sum all the (base 10) digits of 2^powerOfTwo My strategy was to set a calculation which gets the digits one by one, and hope that the compiler could figure out how to calculate each digit without some error like overflow: using System ![]() I know that int, long and double are hopelessly inadequate for holding the 300+ (base 10) digits of 2^1000 precisely, so some strategy is needed. I understand the premise and math of the problem, but I've only started practicing C# a week ago, so my programming is shaky at best. What is the sum of the digits of the number 2^1000? I just need a little nudge and guidance in the right direction, in good faith.ΔΆ^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. ![]() It is discouraged to distribute solutions to the problems, and that isn't what I want. This is a problem from Project Euler, and this question includes some source code, so consider this your spoiler alert, in case you are interested in solving it yourself. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |