哪位大神指点一下,那里错了?
#include<iostream>using namespace std;
int main(){
float a,b,sum;
cin>>a;
cin>>b;
sum=b;
for(int i=1;i<=a;i++)
{
sum=sum+sum*0.0005;
}
cout<<sum;
return 0;
}
#include <iostream> #include <cmath> using namespace std; int main( void ) { printf( "%.2f\n", 4275*pow(1+0.0005,2920) ); }