Advertisement
Guest User

Untitled

a guest
Jan 28th, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. // Struktury.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "string.h"
  6. struct Dane
  7. {
  8. char imie[20];
  9. char nazwisko[25];
  10. char data[11];
  11. };
  12.  
  13. int _tmain(int argc, _TCHAR* argv[])
  14. {
  15. int liczbagosci;
  16. int i = 0;
  17.  
  18. printf("Podaj liczbe gosci\n");
  19. scanf_s("%d", &liczbagosci);
  20.  
  21. struct Dane osoby[10];
  22. for(i = 0; i < liczbagosci; i++)
  23. {
  24.  
  25. printf("Podaj imie\n");
  26. scanf_s("%s", osoby[i].imie, 20);
  27. printf("Podaj nazwisko\n");
  28. scanf_s("%s", osoby[i].nazwisko, 25);
  29. printf("Podaj date urodzenia\n");
  30. scanf_s("%s", osoby[i].data, 12);
  31. }
  32.  
  33. for (int k = 0; k < i; k++)
  34. {
  35. printf("%s %s ur.%s\n", osoby[i].imie, osoby[i].nazwisko, osoby[i].data);
  36. }
  37. getchar();
  38. getchar();
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement