sdnuoj1537(大数)

Tiger Eat People
Description

As we all know, lls is the boss of SDNU ACM Training Team, so many team members may be afraid of him. But this is not the case, lls is very kindly to us. To show his love to us, he plan to give all of us an “Accepted”. The problem shows as follows:There are n numbers ​.Each time you can choose a subset of them(may be empty), and then add them up.Count how many numbers can be represented in this way.

Input

The first line of the input contains an integer T, denoting the number of test cases.
In each test case, there is a single integers n in one line, as described above.
, ​

Output

For each test case, output one line contains a single integer, denoting the answer.

Sample Input

4
9
7
8
233

Sample Output

512
128
256
13803492693581127574869511724554050904902217944340773110325048447598592

看的同学的博客hhh

#include<bits/stdc++.h>
using namespace std;
int main()
{
   
    int t,n;
    unsigned long long m;
    scanf("%d",&t);
    while(t--)
    {
   
        scanf("%d",&n);
        //std::setprecision()控制输出n位有效数字
        //与fixed连用表示控制输出到小数点后几位
        //没有这俩会用e表示输出
        cout<<fixed<<std::setprecision(0)<<pow(2,n)<<'\n';
    }
    return 0;
}

全部评论

相关推荐

11-08 10:39
门头沟学院 C++
点赞 评论 收藏
分享
程序员猪皮:看不到八股什么意思
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务