#include <iostream>
#include <locale.h>
#include <string.h>
#include <stdio.h>
using namespace std;
int main() {
setlocale(LC_ALL, "portuguese");
int idade, cont = 0;
string pro[23];
string nome[23];
string nr[23];
for (int i = 0; i < 2; i++) {
cout << "Digite o seu " << i + 1 <<"º nome, profissão e idade: ";
cin >> nome[i];
cin >> pro[i];
cin >> idade;
if (idade >= 18) {
nr[cont++] = nome[i];
}
}
cout << "número de pessoas maior de 18 anos: " << cont << endl;
for (int i = 0; i < cont; i++) {
cout << "nome: " << nr[i] << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bG9jYWxlLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KI2luY2x1ZGUgPHN0ZGlvLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICBzZXRsb2NhbGUoTENfQUxMLCAicG9ydHVndWVzZSIpOwogICAgaW50IGlkYWRlLCBjb250ID0gMDsKICAgIHN0cmluZyBwcm9bMjNdOwogICAgc3RyaW5nIG5vbWVbMjNdOwogICAgc3RyaW5nIG5yWzIzXTsKCiAgICBmb3IgKGludCBpID0gMDsgaSA8IDI7IGkrKykgewogICAgICAgIGNvdXQgPDwgIkRpZ2l0ZSBvIHNldSAiIDw8IGkgKyAxIDw8IsK6IG5vbWUsIHByb2Zpc3PDo28gZSBpZGFkZTogIjsKICAgICAgICBjaW4gPj4gbm9tZVtpXTsKICAgICAgICBjaW4gPj4gcHJvW2ldOwogICAgICAgIGNpbiA+PiBpZGFkZTsKICAgICAgICBpZiAoaWRhZGUgPj0gMTgpIHsKICAgICAgICAgICAgbnJbY29udCsrXSA9IG5vbWVbaV07CiAgICAgICAgfQogICAgfQoKICAgIGNvdXQgPDwgIm7Dum1lcm8gZGUgcGVzc29hcyBtYWlvciBkZSAxOCBhbm9zOiAiIDw8IGNvbnQgPDwgZW5kbDsKCiAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvbnQ7IGkrKykgewogICAgICAgIGNvdXQgPDwgIm5vbWU6ICIgPDwgbnJbaV0gPDwgZW5kbDsKICAgIH0KICAgIHJldHVybiAwOwp9