Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- typedef struct
- {char nazwisko[30];
- unsigned int nr_albumu;
- char kierunek[5];
- float ocena[10];
- float srednia_ocen;
- } student;
- ///prototypy funkcji
- student wczytaj1();
- void wczytaj2(student*w_s);
- void wyswietl(student s);
- void wczytaj_tab (student*t, int *n);
- void wyswietl_tab(const student*t, int n);
- int main()
- {
- struct infobibl;
- return 0;
- }
- student wczytaj1()
- {
- student s;
- int i;
- printf("\n\t Nazwisko: "); gets(s.nazwisko);
- printf("\n\t nr albumu: "); scanf("%u", &s.nr_albumu);
- getchar();
- printf("\n\t Kierunek: "); gets(s.kierunek);
- puts("\n\t Podaj 3 oceny: ");
- for(i=0; i<3; i++)
- {
- scanf("%f", &s.ocena[i]);
- }
- s.srednia_ocen=0;
- return s;
- }
- void wyswietl1(student s)
- {
- int i;
- printf("\n\t nazwisko: %s\n\t nr albumu: %u\n\t kierunek: %s",
- s.nazwisko, s.nr_albumu,s.kierunek);
- printf("\n\t oceny: ");
- for(i=0; i<3; i++)
- {
- printf(" %.1f",s.ocena[i]);
- }
- if(s.srednia_ocen)
- {
- printf("\n\t srednia: %.1f\n",s.srednia_ocen);
- }
- szlaczek;
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement