Shehan's miscalculation-(processing very large data)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.