123456789101112131415
#include <iostream> #include <iomanip> #include <cmath> using namespace std; int y,r,s,C,n; int main() { double d=1/(1+y/2); cout << setprecision(8); double dirtyprice=pow(d,r/s)*(C/2*(1-pow(d,n+1))/(1-d)+100*pow(d,n)); double accruedinterest=C/2*((s-r)/s); return 0; }