Advertisement
Patresss

2.4

Sep 2nd, 2014
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2. struct rectangle{
  3.     double a;
  4.     double h;};
  5. struct x_rectangle{
  6.     struct rectangle rect;
  7.     double rect_pole;};
  8.  
  9. void oblicz_pole( struct x_rectangle *prostokat)
  10. {
  11.     prostokat->rect_pole=prostokat->rect.a*prostokat->rect.h ;
  12. }
  13.  
  14. int main(void)
  15. {
  16.     struct x_rectangle prostokat;
  17.     scanf("%lf %lf", &prostokat.rect.a,&prostokat.rect.h );
  18.     oblicz_pole(&prostokat);
  19.     printf("[a = %.2lf]*[h = %.2lf] = %.2lf" , prostokat.rect.a, prostokat.rect.h , prostokat.rect_pole);
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement