5 条题解

  • 1
    @ 2023-10-1 15:27:11
    #include<iostream>
    #include<cstdio>
    #include<cmath>
    #include<algorithm>
    using namespace std;
    int main(){
    	int a,b;
    	cin >> a;
    	b = pow(2,a);
    	cout << b;
    	return 0;
    }
    
    • 0
      @ 2024-2-16 16:11:40

      众所周知,有了库函数,我们就不应该使用库函数,要让自己的代码显得很new bee,懂不懂? 代码在下面:

      #include<bits/stdc++.h>
      using namespace std;
      int my_pow(int a, int n){
      	long long ans = 1;
      	for(int i = 1; i <= n; i++){
      		ans = ans * 2;
      	}
      	return ans;
      }
      
      int main(){
      	int n;
      	cin >> n;
      	cout << my_pow(2, n);
      	return 0;
      } 
      
      • 0
        @ 2023-10-22 11:13:22
        #include <bits/stdc++.h>
        using namespace std;
        int main()
        {
            int n;
            cin>>n;
            cout<<(int)pow(2,n);
            return 0;
        }
        
        • 0
          @ 2022-8-13 20:10:44

          #include <bits/stdc++.h> using namespace std; int main(){ int n,s = 1; cin >> n; for(int i = 1;i <= n;i++){ s = s * 2; } cout << s; return 0; }

          • -1
            @ 2022-5-25 22:47:39
            #include<bits/stdc++.h>
            using namespace std;
            long long q,w,e,r,t,y,u,i,o,p,d,f,g,h,j,k,l,z,x,c,v,b,n,m;
            string s;
            long long a[100000],as[100000],asd[100000];
            char cc;
            double dd;
            int main()
            {
            	cin>>x;
            	cout<<fixed<<setprecision(0)<<pow(2,x);
                return 0;
            }
            
            • 1

            信息

            ID
            6846
            时间
            1000ms
            内存
            128MiB
            难度
            1
            标签
            (无)
            递交数
            73
            已通过
            47
            上传者