Advertisement
Guest User

Untitled

a guest
Jan 24th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. float c1,c2,perim,ipot;
  5.  
  6. void ins_dati()
  7. {
  8. cout<<"inserisci primo cateto: ";
  9. cin>>c1;
  10. cout<<"inserisci secondo cateto: ";
  11. cin>>c2;
  12. }
  13. float calcolaperim()
  14. {
  15. ipot=sqrt(c1*c1+c2*c2);
  16. return(c1+c2+ipot);
  17. }
  18. void stampa()
  19. {
  20. cout<<"perimetro = "<<perim<<endl;
  21. }
  22. int main()
  23. {
  24. ins_dati();
  25. perim=calcolaperim();
  26. stampa();
  27. return(0);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement