|
|
|
|
20! 2,432,902,008,176,640,000 2^64 18,446,744,073,709,551,616 21! 51,090,942,171,709,440,000 30! 265,252,859,812,191,058,636,308,480,000,000 34! 295,232,799,039,604,140,847,618,609,643,520,000,000 2^128 340,282,366,920,938,463,463,374,607,431,768,211,456 35! 10,333,147,966,386,144,929,666,651,337,523,200,000,000 40! 815,915,283,247,897,734,345,611,269,596,115,894,272,000,000,000 |
|
|
fernatore wrote: |
---|
what is wrong into the code? |
if(number < 0){
storeMultiplication = storeCount * 1;
|
|
10! = 3,628,800 20! = 2,432,902,008,176,640,000 30! = 265,252,859,812,191,058,636,308,480,000,000 40! = 815,915,283,247,897,734,345,611,269,596,115,894,272,000,000,000 50! = 30,414,093,201,713,378,043,612,608,166,064,768,844,377,641,568,960,512,000,000,000,000 ... lots of very long lines ... |
|
|
echo && echo && g++ -std=c++17 -O3 -Wall -Wextra -pedantic-errors main.cpp && ./a.out computing 1000! (2568 digits) took 0.324 millisecs. computing 5000! (16326 digits) took 7.701 millisecs. computing 10000! (35660 digits) took 13.041 millisecs. computing 30000! (121288 digits) took 136.585 millisecs. |