#include <iostream>
#include <cmath>
using namespace std;
int main()
{
	const int g = 980;
	const float pi = 3.14;
	float p, L, theta;

	cout << "Enter the length of the pendulum in centimeters: ";
	cin >> L;
	cout << "Enter the angle of displacement in degrees: ";
	cin >> theta;

	// Now convert theta to radians.
	theta = theta * (pi / 180);
	p = (2 * pi) * sqrt(L / g) * (1 + 0.25 * pow(sin(theta/2),2));

	cout << "The period of the pendulum is: ";
	cout << p << "." << endl;
	return 0;
}

