dzieciol

xcx

Dec 17th, 2015
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. struct adres{
  7. char kod[6];
  8. char miasto [20];
  9. char ulica [20];
  10. int num_domu;
  11. int num_mieszkania;
  12. };
  13. struct osoba{
  14. struct adres ad2;
  15. char imie[20];
  16. char nazwisko[20];
  17. int wiek;
  18. int pesel;
  19.  
  20. };
  21. struct osoba ad1;
  22.  
  23. printf("podaj imie ");
  24. fgets(ad1.imie,20,stdin);
  25. printf("podaj nazwisko ");
  26. fgets(ad1.nazwisko,20,stdin);
  27. printf("podaj wiek ");
  28. scanf("%d",&ad1.wiek);
  29. printf("podaj pesel ");
  30. scanf("%d",&ad1.pesel);
  31. printf("podaj kod pocztowy");
  32. fgets(ad1.ad2.kod,20,stdin);
  33. printf("podaj miasto");
  34. fgets(ad1.ad2.miasto,20,stdin);
  35.  
  36.  
  37. printf("podaj numer domu ");
  38. scanf("%d",&ad1.ad2.num_domu);
  39. //wyświetlanie
  40. printf(" imie: %s ",ad1.imie);
  41. printf("nazwisko: %s ",ad1.nazwisko);
  42. printf("wiek: %d \n",ad1.wiek);
  43. printf(" pesel: %d \n",ad1.pesel);
  44. printf("miasto: %s",ad1.ad2.miasto);
  45.  
  46.  
  47.  
  48.  
  49. return 0;
  50. }
Add Comment
Please, Sign In to add comment