1 solutions
-
0
C++ :
#include<iostream> #include<math.h> #include<stdio.h> using namespace std; int main(){ double a,b,c,p,s; cin>>a>>b>>c; if(a*a+b*b==c*c||a*a+c*c==b*b||c*c+b*b==a*a) { p=(a+b+c)/2; s=sqrt(p*(p-a)*(p-b)*(p-c)); cout<<"s=";printf("%.2f\n",s); } else cout<<"No!"; return 0; }Pascal :
var a,b,c,p,s:real; begin readln(a,b,c); if (a*a+b*b=c*c) or(a*a+c*c=b*b) or(b*b+c*c=a*a) then begin p:=(a+b+c)/2; s:=sqrt(p*(p-a)*(p-b)*(p-c)); writeln('s=',s:0:2) ;end else writeln('No!'); end.
- 1
Information
- ID
- 17664
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By