Tính tổng

View as PDF

Submit solution

Points: 5.00 (partial)
Time limit: 1.0s
Memory limit: 1G
Input: stdin
Output: stdout

Author:
Problem type
Allowed languages
C, C++, GAS64, Pascal, Perl, PHP, Python, Sed, TCL, Text

Cho số n hãy tính S=1+2+4+8+16+32+...+n (với n<=31)

Input: n

Output: Đưa ra tổng S

Ví dụ:
Input
Copy
8
Output
Copy
15

Comments

Please read the guidelines before commenting.


There are no comments at the moment.