#include <iostream>
#include <string.h>
using namespace std;
struct Agenda{
char nome[50];
int cod;
};
int main()
{
Agenda a[3];
for(int i=0;i<3;i++){
cout << "Nome: ";
cin.get(a[i].nome, 50);
cout << "Cód: ";
cin >> a[i].cod;
cin.ignore();
}
for(int i=0;i<3;i++){
cout << a[i].nome << "\t" << a[i].cod << "\n";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKc3RydWN0IEFnZW5kYXsKICAgIGNoYXIgbm9tZVs1MF07CiAgICBpbnQgY29kOwp9OwoKaW50IG1haW4oKQp7CiAgICBBZ2VuZGEgYVszXTsKCiAgICBmb3IoaW50IGk9MDtpPDM7aSsrKXsKICAgICAgICBjb3V0IDw8ICJOb21lOiAiOwogICAgICAgIGNpbi5nZXQoYVtpXS5ub21lLCA1MCk7CiAgICAgICAgY291dCA8PCAiQ8OzZDogIjsKICAgICAgICBjaW4gPj4gYVtpXS5jb2Q7CiAgICAgICAgY2luLmlnbm9yZSgpOwogICAgfQoKICAgIGZvcihpbnQgaT0wO2k8MztpKyspewogICAgICAgIGNvdXQgPDwgYVtpXS5ub21lIDw8ICJcdCIgPDwgYVtpXS5jb2QgPDwgIlxuIjsKICAgIH0KCgoKICAgIHJldHVybiAwOwp9Cg==