Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- #include <stdio.h>
- #include <stdlib.h>
- using namespace std;
- typedef struct
- {
- unsigned zi, luna, an;
- } datac;
- typedef struct
- {
- char nume[100];
- datac datapers;
- } persoana;
- int main()
- {
- unsigned nrp = 10;
- persoana p[10];
- datac data;
- cin >> data.zi >> data.luna >> data.an;
- for (int i = 0; i < nrp; i++)
- {
- getchar();
- gets(p[i].nume);
- cin >> p[i].datapers.zi >> p[i].datapers.luna >> p[i].datapers.an;
- }
- int zd = (data.an - 1) * 365 + (data.luna - 1) * 30 + data.zi;
- for (int i = 0; i < nrp; i++)
- {
- int z;
- z = (p[i].datapers.an - 1) * 365 + (p[i].datapers.luna - 1) *30 + p[i].datapers.zi;
- if (z - zd >= 18 * 365)
- puts(p[i].nume);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement