Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<conio.h>
  4. #include<ctype.h>
  5.  
  6. typedef struct Pessoa{
  7.  
  8. char Nome[50];
  9. unsigned int Ra;
  10. int CodCurso;
  11. char status;
  12. Pessoa *prox;
  13. };
  14.  
  15. int main() {
  16.  
  17. char OP;
  18.  
  19. Pessoa*Novo, *Fim, *Inicio;
  20.  
  21. do {
  22.  
  23. printf("Digite \n 1 - Inserir \n 2 - Listar \n 3 - Remover \n 4 - Esvaziar \n 5 - Sair ");
  24.  
  25. OP = getche();
  26.  
  27. switch (OP){
  28.  
  29. case'1'://Inserir
  30.  
  31. Novo = (Pessoa*)malloc(sizeof(Pessoa));
  32.  
  33. if (Novo == NULL)
  34. printf("Sem Memoria");
  35.  
  36. else {
  37.  
  38. printf("Nome - ");
  39. fflush(stdin);
  40.  
  41. fgets(Novo->Nome, SYS_OPEN ,stdin);
  42.  
  43. printf("RA");
  44. scanf("%d", &Novo->Ra);
  45.  
  46. printf("Cod Concurso");
  47. scanf("%d", &Novo->CodCurso);
  48.  
  49. printf("Status --------");
  50.  
  51. Novo->status = toupper(getche());
  52. Novo->prox == NULL;
  53. if (Inicio == NULL) {
  54. Inicio = Novo;
  55.  
  56. }
  57. else
  58. Fim->prox = Novo;
  59. Fim = Novo;
  60. }
  61.  
  62. case'2'://Listar
  63.  
  64.  
  65.  
  66. break;
  67.  
  68. }
  69.  
  70.  
  71. } while (OP != 5);
  72.  
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement