Advertisement
tomur

main.c

Jun 8th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. #include <stdio.h>
  2. #include "program.h"
  3. int main()
  4. {
  5. struct dane mojaTabela[1000];
  6. int i;
  7. int rozmiar;
  8. int poprawna = 0;
  9. for(i=0;i<1000;i++)
  10. {
  11. mojaTabela[i].id = i;
  12. printf("Podaj imie: \n");
  13. scanf("%s",mojaTabela[i].imie);
  14. printf("podaj zawod: \n");
  15. scanf("%s",mojaTabela[i].zawod);
  16. printf("podaj wzrost: \n");
  17. scanf("%f",&mojaTabela[i].wzrost);
  18. printf("podaj wage: \n");
  19. scanf("%f",&mojaTabela[i].waga);
  20. printf("czy jest pomocny? podaj '1' jesli tak lub '0' jesli nie\n");
  21. scanf("%d",&mojaTabela[i].czyJestPomocny);
  22. printf("czy chcesz wpisac nastepna osobe? podaj 'Y' jesli tak lub 'N' jesli nie\n");
  23. char odpowiedz;
  24. scanf("%c",odpowiedz);
  25. while(poprawna == 0)
  26. {
  27.  
  28.  
  29. if (odpowiedz == 'Y')
  30. {
  31. poprawna = 1;
  32. } else if (odpowiedz == 'N')
  33. {
  34.  
  35. break;
  36. } else
  37. {
  38. printf("podaj poprawną litere");
  39. scanf("%c", odpowiedz);
  40. }
  41. }
  42. }
  43. sortuj(mojaTabela);
  44. int j;
  45. for(j=0;j<rozmiar;j++)
  46. {
  47. wypiszDane(mojaTabela[j]);
  48. }
  49. printf("Hello, World!\n");
  50. return 0;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement