6 条题解

  • 1
    @ 2023-1-3 14:56:32
    #include<bits/stdc++.h>
    using namespace std;
    float x,ans;
    int n;
    int main()
    {
    	cin>>x>>n;
    	for(int i=n;i>=0;i--)
    	{
    		ans+=pow(x,i);
    	}
    	printf("%.2f",ans);
    	return 0;
    }
    
    • 0
      @ 2025-4-18 20:26:12

      #include<bits/stdc++.h>

      using namespace std;

      int main(){

      double t=1,sum=1,x;
      int n;
      cin>>x>>n;
      for(int i=1;i<=n;i++){
      	t*=x;
      	sum+=t;
      }cout<<fixed<<setprecision(2)<<sum;
      

      }

      • 0
        @ 2024-6-13 14:06:00

        #include《iostream》//cin,cout #include《iomanip》 //cout<<fixed<<setprecision(n){位数保留} using namespace std; float x,sum; int a; int main() { cin>>x>>a; for(int j=a;j>=0;j--) { sum+=pow(x,j); } cout<<fixed<<setprecision(2)<<endl<<endl<<endl<<endl<<endl; cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<sum; return 0; } //dongliyang6666666666666666666skhjkfgjgkjhfgjDV

        • 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;
          }
          # 
          
          
          • 0
            @ 2023-4-14 22:19:35
            #include <stdio.h>
            #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;
            }
            # 
            
            • @ 2023-4-14 22:20:17

              一个非常容易理解的代码

          • 0
            @ 2022-12-15 20:39:02
            #include<iostream>
            #include<iomanip>
            #include <math.h>
            using namespace std;
            int main(){
            	double x,c,s=0,d;
            	int n;
            	cin>>x>>n;
            	int g=x,h; 
            	for(int i=n;i>=1;i--){
            		h=i;
            		c=pow(x,h);
            		s+=c;
            	}
            	d=s+1;
            	cout<<fixed<<setprecision(2)<<d;
            }
            

            太简单了

            • @ 2023-1-3 14:56:12

              什么,万事都不简单

          • 1

          信息

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