/** (c) 2015 Michał (Foxbond) Chraniuk */
#include <stdio.h>
typedef struct student {
char nazwisko[20];
char imie[20];
char nrIndeksu[8];
float ocena;
}student;
int main (){
student *std = (student*)malloc(sizeof(student));
printf("Podaj dane studenta:\nImie: ");
scanf("%s", &std->imie);
printf("Nazwisko: ");
scanf("%s", &std->nazwisko);
printf("Nr indeksu: ");
scanf("%s", &std->nrIndeksu);
printf("Ocena: ");
scanf("%f", &std->ocena);
printf("\n-----------------\nZapisany student:\nNazwisko: %s\nImie: %s\nNr indeksu: %s\nOcena: %.2f\n", std->nazwisko, std->imie, std->nrIndeksu, std->ocena);
getch();
return 0;
}
> Back