SHARE
TWEET

Untitled

a guest Nov 19th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. struct uczen{
  4.     char imie[30];
  5.     char nazwisko[30];
  6.     int polski;
  7.     int matematyka;
  8.     int przyroda;
  9.     int historia;
  10.     int religia;
  11.     int wf;
  12.     };
  13. float srednia (struct uczen a)
  14. {
  15. return((a.polski + a.matematyka + a.przyroda + a.historia + a.religia + a.wf)/6.0);
  16. }
  17. int main()
  18. {
  19.      struct uczen Nowak = {"Jan", "Nowak", 5, 4, 6, 3, 5, 3};
  20.      struct uczen Kowalski = {"Jakub", "Kowalski", 5, 6, 6, 3, 5, 2};
  21.      struct uczen Lilak = {"Hanna", "Lilak", 5, 4, 6, 3, 5, 3};
  22.  
  23.     printf("Srednia Nowaka wynoni %.2f\n", srednia(Nowak));
  24.     printf("Srednia Kowalski wynoni %.2f\n", srednia(Kowalski));
  25.     printf("Srednia Lilak wynoni %.2f\n", srednia(Lilak));
  26.    
  27.     int zliczanie[6];
  28.     for(int i; i<6; ++i)
  29.     {
  30.         zliczanie[i] = 0;
  31.     }
  32.    
  33.    
  34.     return 0;
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top