请问为什么Python用如下代码就可以过,C++不行
查看原帖
请问为什么Python用如下代码就可以过,C++不行
601639
fkcufk楼主2023/4/8 16:15

Python 代码:

print(2**(int(input())+1)-2)

C++ 代码:

#include<bits/stdc++.h>
using namespace std;
int n;
int main(){
    cin>>n;
    cout<<pow(2,n+1)-2;
	return 0;
}
2023/4/8 16:15
加载中...