Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Пик 3 №1.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <stdio.h>
- struct Student {
- char Name[50];
- int FN;
- float Uspeh;
- };
- typedef struct Student STUD;
- typedef struct {
- char NameG[5];
- int br;
- STUD St[30];
- }GRUP;
- typedef struct {
- char NameF[50];
- int brg;
- GRUP GR[20];
- }FACULTET;
- void InputSt(STUD*S) {
- printf("Vavedete ime na student:\n");
- gets_s(S->Name);
- printf("Vavedete fak.nomer\n");
- scanf_s("%d", &S->FN);
- while (S->Uspeh < 2 || S->Uspeh>6) {
- printf("Vavedete uspeh na studenta\n");
- scanf_s("%f", &S->Uspeh);
- }
- }
- //void InputSt(STUD st[], int num) {
- // int i;
- // for ( i = 0; i < num; i++)
- // {
- // printf("Vavedete ime na student:\n");
- // gets_s(st->Name);
- // printf("Vavedete fak.nomer\n");
- // scanf_s("%d", st->FN);
- // printf("Vavedete uspeh na studenta\n");
- // scanf_s("%f", st->Uspeh);
- // }
- //}
- void InputGroup(GRUP*Gr) {
- printf("Vavedete ime na grupata\n");
- gets_s(Gr->NameG);
- printf("Vavedete broi studenti\n");
- scanf_s("%d", &Gr->br);
- for (int i = 0; i <Gr->br; i++)
- {
- InputSt(&Gr->St[i]);
- }
- };
- //void InputGroup(GRUP*Gr) {
- // printf("Vavedete ime na grupata\n");
- // gets_s(Gr->NameG);
- // printf("Vavedete broi studenti\n");
- // scanf_s("%d", &Gr->br);
- // InputSt(Gr->St,Gr->br);
- //
- //
- //};
- //void InputFacultet(FACULTET *F) {
- // printf("vavedete ime na fakulteta\n");
- // gets_s(F->NameF);
- // printf("Vavedete broi grupi\n");
- // scanf_s("%d", &F->brg);
- //
- // for (int i = 0; i < F->brg; i++)
- // {
- // InputGroup(&F->GR[i]);
- //
- // }
- //}
- void printStUspeh(FACULTET*F,STUD st[]) {
- printf("facultet:%s\n", F->NameF);
- printf("student uspeh:%f\n", st->Uspeh);
- }
- int main()
- {
- /*int n,i;
- printf("vavedete broi studenti.");
- scanf("%d", &n);
- for (i = 0; i < n; i++)
- {
- InputSt(&Gr->St);
- }
- */
- /* printf("vavedete ime na fakulteta\n ");
- gets_s(f.NameF);
- printf("Vavedete broi grupi\n");
- scanf_s("%d", &f.brg);
- for (int i = 0; i < f.brg; i++)
- {
- InputGroup(&f.GR[i]);
- printStUspeh(&f, &st);
- }*/
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement