Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. typedef struct
  5. {char nazwisko[30];
  6. unsigned int nr_albumu;
  7. char kierunek[5];
  8. float ocena[10];
  9. float srednia_ocen;
  10.  
  11. } student;
  12.  
  13. ///prototypy funkcji
  14.  
  15. student wczytaj1();
  16.  
  17. void wczytaj2(student*w_s);
  18.  
  19. void wyswietl(student s);
  20.  
  21. void wczytaj_tab (student*t, int *n);
  22.  
  23. void wyswietl_tab(const student*t, int n);
  24.  
  25.  
  26. int main()
  27. {
  28. struct infobibl;
  29. return 0;
  30. }
  31.  
  32. student wczytaj1()
  33. {
  34. student s;
  35. int i;
  36.  
  37. printf("\n\t Nazwisko: "); gets(s.nazwisko);
  38. printf("\n\t nr albumu: "); scanf("%u", &s.nr_albumu);
  39. getchar();
  40. printf("\n\t Kierunek: "); gets(s.kierunek);
  41.  
  42. puts("\n\t Podaj 3 oceny: ");
  43. for(i=0; i<3; i++)
  44. {
  45. scanf("%f", &s.ocena[i]);
  46. }
  47.  
  48. s.srednia_ocen=0;
  49.  
  50. return s;
  51. }
  52.  
  53. void wyswietl1(student s)
  54. {
  55. int i;
  56.  
  57. printf("\n\t nazwisko: %s\n\t nr albumu: %u\n\t kierunek: %s",
  58. s.nazwisko, s.nr_albumu,s.kierunek);
  59.  
  60. printf("\n\t oceny: ");
  61.  
  62. for(i=0; i<3; i++)
  63. {
  64. printf(" %.1f",s.ocena[i]);
  65. }
  66. if(s.srednia_ocen)
  67. {
  68. printf("\n\t srednia: %.1f\n",s.srednia_ocen);
  69. }
  70.  
  71. szlaczek;
  72. return;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement