Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include "program.h"
- int main()
- {
- struct dane mojaTabela[1000];
- int i;
- int rozmiar;
- int poprawna = 0;
- for(i=0;i<1000;i++)
- {
- mojaTabela[i].id = i;
- printf("Podaj imie: \n");
- scanf("%s",mojaTabela[i].imie);
- printf("podaj zawod: \n");
- scanf("%s",mojaTabela[i].zawod);
- printf("podaj wzrost: \n");
- scanf("%f",&mojaTabela[i].wzrost);
- printf("podaj wage: \n");
- scanf("%f",&mojaTabela[i].waga);
- printf("czy jest pomocny? podaj '1' jesli tak lub '0' jesli nie\n");
- scanf("%d",&mojaTabela[i].czyJestPomocny);
- printf("czy chcesz wpisac nastepna osobe? podaj 'Y' jesli tak lub 'N' jesli nie\n");
- char odpowiedz;
- scanf("%c",odpowiedz);
- while(poprawna == 0)
- {
- if (odpowiedz == 'Y')
- {
- poprawna = 1;
- } else if (odpowiedz == 'N')
- {
- break;
- } else
- {
- printf("podaj poprawną litere");
- scanf("%c", odpowiedz);
- }
- }
- }
- sortuj(mojaTabela);
- int j;
- for(j=0;j<rozmiar;j++)
- {
- wypiszDane(mojaTabela[j]);
- }
- printf("Hello, World!\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement