## 10195 - The Knights Of The Round Table

Moderator: Board moderators

sohel
Guru
Posts: 856
Joined: Thu Jan 30, 2003 5:50 am
Location: New York
seems to be correct..
.. but watch out for outputs like -0.000.

J&Jewel
New poster
Posts: 50
Joined: Thu Jul 31, 2003 10:43 am
Contact:
Thanks I get Ac..

asif_rahman0
Experienced poster
Posts: 209
Joined: Sun Jan 16, 2005 6:22 pm

### 10195

Here is my code.Plz tell me where is the mistakes?
#include<stdio.h>
#include<math.h>

void main()
{
double a,b,c,S,r;
while(1)
{
scanf("%lf %lf %lf",&a,&b,&c);
if(feof(stdin))
break;
S=(a+b+c)/2;
r = sqrt((S-a)*(S-b)*(S-c)/S);
printf("The radius of the round table is: %.3lf",r);
}
}

asif_rahman0
Experienced poster
Posts: 209
Joined: Sun Jan 16, 2005 6:22 pm

### 10195

Here is my code.Plz tell me where is the mistakes?
#include<stdio.h>
#include<math.h>

void main()
{
double a,b,c,S,r;
while(1)
{
scanf("%lf %lf %lf",&a,&b,&c);
if(feof(stdin))
break;
S=(a+b+c)/2;
r = sqrt((S-a)*(S-b)*(S-c)/S);
printf("The radius of the round table is: %.3lf",r);
}
}

Sanny
Learning poster
Posts: 78
Joined: Sat Feb 14, 2004 3:59 pm
Location: BUET
Contact:
If any of the sides are zero, the area should be zero.

J&Jewel
New poster
Posts: 50
Joined: Thu Jul 31, 2003 10:43 am
Contact:
to....asif
If s=0 then divide error should be occur.....( )/s.
so if s=0 then just print 0.000

I hope u get accepted.

Rocky
Experienced poster
Posts: 124
Joined: Thu Oct 14, 2004 9:05 am
Contact:

That's The Main Case Of This Problem.
I Think Now You Get AC ASiF.

Jemerson
Learning poster
Posts: 59
Joined: Mon Feb 02, 2004 11:19 pm
Contact:

### 10195 - Java WA HEEEEELLLPPP

#JAVA

Code: Select all

`` Accepted``
Guess im facing precision errors, can anyone please check it?

Thanx
[/quote]

smilitude
Experienced poster
Posts: 137
Joined: Fri Jul 01, 2005 12:21 am

### 10195 WA WA WA

I dont know, why I am getting so glorious WAs( )in this FALTOO problem.
If you know, why this GLORIOUS thing is happening to me... plz let me know...

Code: Select all

``````cut
[code]``````
Last edited by smilitude on Wed Oct 12, 2005 2:51 am, edited 1 time in total.
fahim
#include <smile.h>

kwedeer
New poster
Posts: 44
Joined: Thu Dec 15, 2005 11:28 pm
why I am reciving WA? Any idea, please? All seems to be perfect and task seems to be pretty simple...

Here is my code:

Code: Select all

``````program Prg10195(input, output);

{\$APPTYPE CONSOLE}

uses
SysUtils;
{simple use of triangle formula???}
var
a,b,c,S,res: double;
resp: string;
begin
{
AssignFile(Input, 'in10__.txt');
Reset(Input);
AssignFile(Output, 'out10__.txt');
Rewrite(Output);}
while (not Eof) do begin
if ((a=0.0) or
(b=0.0) or
(c=0.0)) then begin
res:=0.0;
end else begin
S:=((a+b+c)/2.0);
res:=sqrt(( (S-a)*(S-b)*(S-c) )/S);
end;
resp:=Format('The radius of the round table is: %.3f', [res]);
writeln(resp);
end;
end.``````
Thanx for any hint in advance!

kwedeer
New poster
Posts: 44
Joined: Thu Dec 15, 2005 11:28 pm
Is any established procedure (in the sense of usual quality management practices in software development industry) how to overcome this case - I have code (OK, pretty small - but this is not a issue here) that conforms to all imaginable test cases and it is rejected by judge... OK - usual advice here was - to publish code... I did - but no any feedbacj till now...

I can sey n-time pleaz, pleaz, pleaz - with hope - that it can help...

(((((((((((((((((

Debashis Maitra
Learning poster
Posts: 62
Joined: Sun Jul 09, 2006 8:31 am
Location: University of Dhaka
Contact:

### Why WA

Why WA

Code: Select all

``````
removed
``````
Last edited by Debashis Maitra on Fri Dec 08, 2006 6:28 pm, edited 2 times in total.
Akash chhoyar swopno
Dream to touch the sky

helloneo
Guru
Posts: 516
Joined: Mon Jul 04, 2005 6:30 am
Location: Seoul, Korea
check it again..

Debashis Maitra
Learning poster
Posts: 62
Joined: Sun Jul 09, 2006 8:31 am
Location: University of Dhaka
Contact:
thanx
helloneo
Akash chhoyar swopno
Dream to touch the sky

starrynight
New poster
Posts: 7
Joined: Mon Mar 05, 2007 3:24 pm

### 10195--CE

int main()
{
double a ,b ,c ,r ,s ,s2 ,area;

while (scanf("%lf %lf %lf",&a,&b,&c) != EOF)
{

s = ( a + b + c ) / 2.0;
area = sqrt(s * (s-a) * (s-b) * (s-c));
s2 = a + b + c;
r = 2.0 * area * (1.0 / s2);
printf("The radius of the round table is: %.3lf\n",r);

}

return 0;
}

i wrote this in C!
who can tell me why i got a CE?
thx