delete pics to save space
This commit is contained in:
18
history_source/信息学奥赛一本通/1.4.4.3.cpp
Normal file
18
history_source/信息学奥赛一本通/1.4.4.3.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include<cstdio>
|
||||
#include<cmath>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
float x;
|
||||
int n;
|
||||
scanf("%f%d",&x,&n);
|
||||
float ans=0,times=1;
|
||||
for(int i=0;i<=n;i++)
|
||||
{
|
||||
ans+=times;
|
||||
times*=x;
|
||||
}
|
||||
printf("%f\n",ans);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user