#include <stdio.h>
typedef struct {
char nome[ 31 ] ;
char profissao[ 31 ] ;
int idade;
int ativado;
} Pessoa;
void cadastrar( Pessoa pessoas[ 3 ] ) {
int op;
int i = 0 ;
do {
fgets ( pessoas
[ i
] .
nome , sizeof ( pessoas
[ i
] .
nome ) , stdin
) ; fgets ( pessoas
[ i
] .
profissao , sizeof ( pessoas
[ i
] .
profissao ) , stdin
) ; scanf ( "%d" , & pessoas
[ i
] .
idade ) ; printf ( "\n 1 - Continuar\n 0 - para sair\n " ) ; printf ( "Digite sua escolha: " ) ; i++;
} while ( i < 3 && op != 0 ) ;
}
int main( ) {
Pessoa pessoas[ 3 ] ;
int op;
do {
printf ( "\n Para cadastrar pessoas aperte 1\n " ) ; switch ( op) {
case 1 :
cadastrar( pessoas) ;
break ;
}
} while ( op != 0 ) ;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp0eXBlZGVmIHN0cnVjdCB7CiAgICBjaGFyIG5vbWVbMzFdOwogICAgY2hhciBwcm9maXNzYW9bMzFdOwogICAgaW50ICBpZGFkZTsKICAgIGludCBhdGl2YWRvOwp9IFBlc3NvYTsKCnZvaWQgY2FkYXN0cmFyKFBlc3NvYSBwZXNzb2FzWzNdKSB7CiAgICBpbnQgb3A7CiAgICBpbnQgaSA9IDA7CiAgICBkbyB7CiAgICAgICAgcHJpbnRmKCJcbk5vbWU6ICIpOwogICAgICAgIGZnZXRzKHBlc3NvYXNbaV0ubm9tZSwgc2l6ZW9mKHBlc3NvYXNbaV0ubm9tZSksIHN0ZGluKTsKICAgICAgICBwcmludGYoIlxuUHJvZmlzc8OjbzogIik7CiAgICAgICAgZmdldHMocGVzc29hc1tpXS5wcm9maXNzYW8sIHNpemVvZihwZXNzb2FzW2ldLnByb2Zpc3NhbyksIHN0ZGluKTsKICAgICAgICBwcmludGYoIlxuSWRhZGU6ICIpOwogICAgICAgIHNjYW5mKCIlZCIsICZwZXNzb2FzW2ldLmlkYWRlKTsKICAgICAgICBwcmludGYoIlxuMSAtIENvbnRpbnVhclxuMCAtIHBhcmEgc2FpclxuIik7CiAgICAgICAgcHJpbnRmKCJEaWdpdGUgc3VhIGVzY29saGE6ICIpOwogICAgICAgIHNjYW5mKCIlZCIsICZvcCk7CiAgICAgICAgaSsrOwogICAgfSB3aGlsZSAoaSA8IDMgJiYgb3AgIT0gMCk7Cn0KCmludCBtYWluKCkgewogICAgUGVzc29hIHBlc3NvYXNbM107CiAgICBpbnQgb3A7CiAgICBkbyB7CiAgICAgICAgcHJpbnRmKCJcblBhcmEgY2FkYXN0cmFyIHBlc3NvYXMgYXBlcnRlIDFcbiIpOwogICAgICAgIHNjYW5mKCIlZCIsICZvcCk7CiAgICAgICAgc3dpdGNoIChvcCkgewogICAgICAgIGNhc2UgMToKICAgICAgICAgICAgY2FkYXN0cmFyKHBlc3NvYXMpOwogICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICB9IHdoaWxlIChvcCAhPSAwKTsKfQ==