Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #include <string.h>
- typedef struct {
- int id;
- char imie[20];
- char nazwisko[20];
- int rok_u, mies_u, dzien_u;
- } tosoba;
- int main() {
- int los1 = 1 + rand() % 100;
- int los2 = 0 + rand() % 100;
- int los3 = 0 + rand() % 100;
- int los4 = 1900 + rand() % 2000;
- int los5 = 1 + rand() % 13;
- int los6 = 1 + rand() % 32;
- tosoba osoba1 = {los1, "imie" + 2, "naz", los4, los5, los6};
- printf ("ID: %d \n", osoba1.id);
- printf ("Imie: %s \n", osoba1.imie);
- printf ("Nazwisko: %s \n", osoba1.nazwisko);
- printf ("Data urodzenia(YYYY-MM-DD): %d . %d . %d \n", osoba1.rok_u, osoba1.mies_u, osoba1.dzien_u);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement