codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include<iostream> #include <math.h> using namespace std; bool checktamgiac (int a, int b, int c) { if ((a + b > c) && (a + c > b) && (b + c > 1)) return true; return false; } float tinhdientichtg(int a, int b, int c) { float p = (float)(a + b + c) / 2; float s = sqrt((p - a) + (p - b) + (p - c)); return s; } int main() { int a, b, c; cout << "nhap a =" <<endl; cin >> a; cout << "nhap b =" << endl; cin >> b; cout << "nhap c =" << endl; cin >> c; if(checktamgiac(a,b,c)== true) cout << "la mot tam giac co dien tich la" << tinhdientichtg(a, b, c); else cout << "khong phai la mot tam giac "; return 0; }
Private
[
?
]
Run code
Submit