Consegui com o pessoal da minha sala de aula desenvolver, tá ai: #include <stdlib.h>
#include <string.h>
#include <stdio.h>
typedef struct registro{
int num;
struct registro *ant;
}registro;
registro *criar(int valor){
registro *aux;
aux = (registro *)malloc( sizeof(registro) );
if(!aux)
return(NULL);
aux->num = valor;
aux->ant = NULL;
return(aux);
}
registro *inserir(registro *topo, int valor){
registro *aux;
aux = criar(valor);
if(!aux){
printf("\n\t\t Erro de alocacao de memoria\n");
}
else {
aux->ant = topo;
topo = aux;
}
return topo;
}
imp_par(registro *cabeca){
int i, j=0;
registro *aux;
if(!cabeca){
printf("\n\n \t\t Nenhum numero cadastrado \n\n\n");
getchar();
}else {
for(aux = cabeca; aux!=NULL; aux = aux->ant){
i = aux->num;
if (i%2==0){
if (j<1){
printf ("\n\nNumeros Pares cadastrados: \n\n");
}
printf("Numero: %d\n", aux->num);
j++;
}
}
if(j==0){
printf("\n\n\t\tNenhum numero Par cadastrado\n\n\n");
}
}
system("pause");
}
imp_impar(registro *cabeca){
int i, j=0;
registro *aux;
if(!cabeca){
printf("\n\n \t\t Nenhum numero cadastrado \n\n\n");
getchar();
}else {
for(aux = cabeca; aux!=NULL; aux = aux->ant){
i = aux->num;
if (i%2>0){
if (j<1){
printf ("\n\nNumeros Impares cadastrados: \n\n");
}
printf("Numero: %d\n", aux->num);
j++;
}
}
if(j==0){
printf("\n\n\t\tNenhum numero impar cadastrado\n\n\n");
}
}
system("pause");
}
imp_tudo(registro *cabeca){
int i,j = 0;
registro *aux;
if(!cabeca){
printf("\n\n \t\tNenhum numero cadastrado \n\n\n");
getchar();
}else {
for(aux = cabeca; aux!=NULL; aux = aux->ant){
if (j<1){
printf("\n\nTodos os numeros cadastrados no sistema: \n\n");
}
printf("Numero: %d\n", aux->num);
j++;
}
}
system("pause");
}
main(){
int x, valor, cont=0,opc=5;
registro *topo = NULL;
while (opc!=0){
printf (" \t[1] Inserir numeros\n\n \t[2] Imprimir numeros pares\n\n \t[3] Imprimir numeros impares\n\n \t[4] Imprimir todos os numeros\n\n \t[5] Sair\n\n");
printf("Opcao: ");
scanf ("%d", &x);
switch (x){
case 1:
printf("\nQual o valor a ser cadastrado: ");
scanf ("%d", &valor);
if (cont<2){
topo = inserir(topo,valor);
cont++;
}
else
printf ("Quantidade de numeros excedidos!\n\n");
system ("pause");
system ("cls");
break;
case 2:
system ("cls");
imp_par(topo);
system ("cls");
break;
case 3:
system ("cls");
imp_impar(topo);
system ("cls");
break;
case 4:
system ("cls");
imp_tudo(topo);
system ("cls");
break;
case 5:
exit(0);
default:
system("cls");
printf("\n\n\t\t\tOpcao invalida.\n\n\n");
fflush(stdin);
getchar();
system("cls");
}
}
system ("pause");
} até :*