Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_DEPRECATE
- #define CRT_NO_SECURE_WARNINGS
- #include <stdio.h>
- #include <stdlib.h>
- #define MAXNAME 20
- #define MAX 5
- typedef struct student
- {
- char imie[ MAXNAME ];
- char nazwisko[ MAXNAME ];
- float oceny[ MAX ];
- int nr_dz;
- float srednia;
- }student;
- void dodaj_oceny( student &student );
- void wyswietl_oceny( student student );
- int main( int argc, char *argv[] )
- {
- struct student student1;
- printf( "Podaj imie studenta\n" );
- scanf( "%s", &student1.imie );
- printf( "Podaj nazwisko studenta\n" );
- scanf( "%s", &student1.nazwisko );
- printf( "Podaj numer dziennika studenta\n" );
- scanf( "%d", &student1.nr_dz );
- printf( "Wprowadzono nastepujace dane studenta:\n" );
- printf( "Imie: %s\n Nazwisko: %s\n Numer dziennika: %d\n", student1.imie, student1.nazwisko, student1.nr_dz );
- dodaj_oceny( student1 );
- wyswietl_oceny( student1 );
- system( "PAUSE" );
- return 0;
- }
- void dodaj_oceny( student &example )
- {
- printf( "Podaj 5 ocen studenta\n" );
- for( int i = 0; i < MAX; i++ )
- {
- scanf( "%f", &example.oceny[ i ] );
- }
- }
- void wyswietl_oceny( student student )
- {
- for( int i = 0; i < MAX; i++ )
- {
- printf( "%f\t", student.oceny[ i ] );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement