ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Турниры > CEN111 Homeworks 2013-2015 > задача:


14-Fall2-60. 50487 - Radius of Inscribed Circle

CEN111 Homeworks 2013-2015

Старт: 10.янв.2015 в 10:00:00
Финиш: 10.янв.2015 в 15:00:00
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (2)

Задачи турнира

• 14-Fall1-30. 50500 - Find Student
• 14-Fall1-40. 50511 - Class Average
• 14-Fall1-50. 50481 - Car Parking
• 14-Fall2-10. 50510 - What floor are ...
• 14-Fall2-20. 50504 - School contest
• 14-Fall2-30. 50523 - Total Tax to Pay
• 14-Fall2-40. 50514 - Bookkeeping
• 14-Fall2-50. 50534 - Top Trading C...
• 14-Fall2-60. 50487 - Radius of ...
• 14-FallResit-20. 50407 - Missing Nu...
• 14-Spr2-10. 50426 - Calculating Sales
• 14-Spr2-20. 50425 - Calculating W...
• 14-Spr2-30. 50445 - Cryptography
• 14-Spr2-50. 50437 - Age Labeling
• 15-FallHW-2. 50821 - Derivative of ...
• 15-FallHW-3. 50822 - Linked List
• 15-FallHW-4. 50823 - Secret Number

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Meral Ari.

Radius of Inscribed Circle

The area of a triangle is given by area = √ d  where d = s.(s-a).(s-b).(s-c). In the given formulas; a, b, and c are the lengths of the sides of the given triangle, and s is the semiperimeter of the triangle with the formula
s = (a + b + c) / 2

The radius of the inscribed circle r is given by the equation r = area / s and the radius of the circumscribed circle R is given by the equation R = (a*b*c)/(4*area)

Question: Write a program to read in the lengths of the sides of user defined number (n) of triangles. If d is a positive number, compute and print

  1. area
  2. radius of the inscribed circle (r)
  3. radius of the circumscribed circle (R)
for each triangle to a separate line. If the value of d for any given data is less than or equal to zero; print "Wrong Data!" and pass to next data.

Input specification
You will be given an integer (n) the number of triangles where 0 ≤ n ≤ 1000. Then, in each of the following n lines you will be given 3 integer numbers (lengths of the sides of each triangle: a, b, c)

Output specification:
If d is positive show three floating point numbers with 2 digits precision.

  1. area
  2. radius of the inscribed circle (r)
  3. radius of the circumscribed circle (R)
If d is zero or negative show the message "Wrong Data!"

Sample Input I
2
2 3 4
3 5 7
Sample Input II
2
8 2 4
7 5 4
Sample Output I
2.90 0.65 2.07
6.50 0.87 4.04
Sample Output II
Wrong Data!
9.80 1.22 3.57



Для отправки решений необходимо выполнить вход.

www.contester.ru