/*
 *  angle.c
 *  
 *
 *  Created by xwu3 on 3/1/09.
 *  Copyright 2009 University of Iowa. All rights reserved.
 *
 */

#include<stdio.h>
#include<math.h>

int main (void)
{
	double a, b, c;
	double angle;
	double degree;
	
	printf( "Enter three edges of the triangle: ");
	scanf( "%lf%lf%lf", &a, &b, &c);
		
	if ((a + b > c) && (a + c > b) && (b + c > a)) { /* a, b and c form a triangle */
		angle = acos((a*a + b*b - c*c)/(2*a*b));
		degree =angle * 180 / M_PI;
		printf( "The angle is %.2f\n", degree);
	}
	else { /* a, b and c do NOT form a triangle */
		printf( "The input three edges cannot form a triangle.\n");
	}
	
	return 0;
}
	
	
	
