#include <iostream>
#include <vector>
using namespace std;
struct Person {
unsigned int id;
std::string name;
uint8_t age;
// ...
};
int main() {
std::istream& ifs = cin; // Open file alternatively
std::vector<Person> persons;
Person actRecord;
while(ifs >> actRecord.id >> actRecord.name >> actRecord.age) {
persons.push_back(actRecord);
}
if(!ifs) {
std::cerr << "Input format error!" << std::endl;
return -1;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnN0cnVjdCBQZXJzb24gewogICAgdW5zaWduZWQgaW50IGlkOwogICAgc3RkOjpzdHJpbmcgbmFtZTsKICAgIHVpbnQ4X3QgYWdlOwogICAgLy8gLi4uCn07CgppbnQgbWFpbigpIHsKCiAgICBzdGQ6OmlzdHJlYW0mIGlmcyA9IGNpbjsgLy8gT3BlbiBmaWxlIGFsdGVybmF0aXZlbHkKICAgIHN0ZDo6dmVjdG9yPFBlcnNvbj4gcGVyc29uczsKCiAgICBQZXJzb24gYWN0UmVjb3JkOwogICAgd2hpbGUoaWZzID4+IGFjdFJlY29yZC5pZCA+PiBhY3RSZWNvcmQubmFtZSA+PiBhY3RSZWNvcmQuYWdlKSB7CiAgICAgICAgcGVyc29ucy5wdXNoX2JhY2soYWN0UmVjb3JkKTsKICAgIH0KCiAgICBpZighaWZzKSB7CiAgICAgICAgc3RkOjpjZXJyIDw8ICJJbnB1dCBmb3JtYXQgZXJyb3IhIiA8PCBzdGQ6OmVuZGw7CiAgICAgICAgcmV0dXJuIC0xOwogICAgfSAKCXJldHVybiAwOwp9