View Code of Problem 72

#include <stdio.h>
int main()
{
	int M, N;
	
	scanf("%d%d", &M, &N);
	float total = M, n = M / 2.0;
	for (int i = 2; i <= N; i++)
	{
		total = total + 2 * n;
		n = n / 2.0;
		
	}
	printf("%.2f %.2f\n", n, total);
	return 0;
}

Double click to view unformatted code.


Back to problem 72