1056: "C language Training" King's miscalculation time limit:1 Sec Memory limit:128 MB
submit:276 solved:248
[Submit] [Status] [BBS] Description
Legend has it that chess was invented by Dail, the prime Minister of the ancient Indian king. Shehan very fond of chess, decided to let the Prime Minister himself to choose what kind of reward. The wise Prime Minister pointed to the 8*8 total of 64 chess said: "Your Majesty, please give me some wheat." The 1th Geffon of the Chessboard, 2nd Geffon 2 capsules, In the future, each lattice will be one more than the previous one, so I will be grateful for the 164 squares of the board. The King of Hampshire carried a sack of wheat, and he fulfilled his promise.
May I ask, how many grains of wheat will the King reward his prime minister for fulfilling his promise?
Input Output
Output as integers, no other symbols
Sample Input Sample Output HINT
Should be a very large number, to consider the accuracy of the problem! With the double type, output the result as accurate as possible.
Source
#include <stdio.h>int main () { double s=1.0, sum=0.0; for (int i=2; i<=; i++) { s*=2; Sum+ =s; } printf ("%.0f\n", sum); return 0 ;}
Shehan's miscalculation-(processing very large data)