#include <stdio.h>Các bạn xem thêm đây để hiểu nhé:http://hocccoban.org/2015/03/21/code-kiem-tra-tam-giac.html#include <onio.h> bool KiemTraTamGiac (int a, int b, int c) { if (a+b >c && b + c > a && a +c >b) return true; return false; } void LoaiTamGiac (int a, int b, int c) { if (a*a + b*b == c*c || a*a + c*c == b*b || c*c + b*b == a*a) { printf ("\nDay la tam giac vuong "); } else printf ("\nDay la tam giac thuong"); } int main () { int a,b,c; printf ("\nNhap do dai 3 canh cua tam giac : \n"); scanf ("%d%d%d",&a,&b,&c); KiemTraTamGiac (a,b,c); if (KiemTraTamGiac (a,b,c)== true) { LoaiTamGiac (a,b,c); } else printf ("\nDo dai 3 canh vua nhap khong phai la 3 canh cua mot tam giac"); getch (); return 0; }
About Author
The part time Blogger love to blog on various categories like Web Development, SEO Guide, Tips and Tricks, Android Stuff, etc including Linux Hacking Tricks and tips. A Blogger Template Designer; designed many popular themes.
Advertisement
Subscribe to:
Post Comments (Atom)
Post a Comment