View Code of Problem 72

#include<iostream>
#include<algorithm>
using namespace std;

int main(){
	float m,n;
	cin>>m>>n;
	float temp=1000;
	for(int i=1;i<=n;i++){
		//temp=temp+m;
		m=m/2;
		
		temp=temp+m*2;
		//printf("%.2f ",m);
	}
	cout<<'\n';
	temp=temp-2*m;
	printf("%.2f %.2f",m,temp);
	
	
} 

Double click to view unformatted code.


Back to problem 72