Advertisement
nguyenhappy92

Tính và xuất chu vi, diện tích hình thoi

Oct 15th, 2015
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. // tinh chu vi va dien tich hinh thoi
  2. // Khai bao cac ham thu vien
  3.  
  4. #include<stdio.h>
  5. #include<conio.h>
  6.  
  7. void main()
  8. {
  9. int a,h1,h2;
  10. scanf(" %d%d%d", &a,&h1,&h2);
  11. int chuvi;
  12. chuvi=4*a;
  13. float dientich;
  14. dientich=(float)1/(2*h1*h2);
  15. printf(" Chu vi hinh thoi: %d\n", chuvi);
  16. printf(" Dien tich hinh thoi: %.2f\n",dientich);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement