5 条题解

  • 0
    @ 2023-4-15 17:08:04
    #include <string.h>
    #include <queue>
    #include <math.h>
    #include <vector>
    #include <algorithm>
    #include <iomanip>
    #include <stack>
    #include<cstring>
    #include <bits/stdc++.h>
    using namespace std;
    double x,ans=0,d;
    int n;
    int main(){
    	cin>>x>>n;
    	for ( int i=n ; i>=1; i--){
    		ans+=pow(x,i);
    		
    	}
    	d=ans+1;
    	cout << fixed<<setprecision(2)<<d;
    	return 0;
    }
    # 
    
    

    信息

    ID
    915
    时间
    1000ms
    内存
    128MiB
    难度
    4
    标签
    递交数
    235
    已通过
    101
    上传者