Advertisement
Guest User

Untitled

a guest
May 26th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.24 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. #define MIN 50
  5. #define MAX 250
  6.  
  7. #define qtd_alunos 2
  8.  
  9. typedef struct {
  10.     char _nomes[MIN][MAX],_nomes1[MIN][MAX];
  11. }_alunos;
  12.  
  13. void imprimir(const char name[MIN][MAX])
  14. {
  15.    
  16.     int y;
  17.     for(y=0; y <=qtd_alunos; y++){
  18.         printf("%s \n",name[y]);
  19.     }
  20. }
  21.  
  22. void matricula()
  23. {
  24.     int qtd=2,y,opc;
  25.     _alunos *a = (_alunos *) malloc(sizeof(_alunos));
  26.    
  27.     printf("\n [1] Alunos Sem Deficiencia \n [2] Alunos Com Deficiencia \n");
  28.     scanf("%d",&opc);
  29.    
  30.     if (opc == 1)
  31.     {
  32.         for(y=0; <= qtd_alunos; y++){
  33.             printf("\n Digite Os nomes \n");
  34.             scanf("%s",a->_nomes[y]);
  35.         }
  36.     }else if(opc == 2)
  37.     {
  38.         for(y=0; y <= qtd_alunos; y++){
  39.             printf("\n Digits os Nomes dos Alunos com Deficiencia: ");
  40.             scanf("%s",a->_nomes1[y]);
  41.         }
  42.     }
  43.    
  44. }
  45.  
  46. int main()
  47. {
  48.     int opc;
  49.    
  50.    
  51.     for(;;){
  52.         printf("\n digite opc: ");
  53.         scanf("%d",&opc);
  54.    
  55.         switch(opc){
  56.             case 1:
  57.                 matricula();
  58.                 break;
  59.             case 2:
  60.                 pesquisa();
  61.                 break;
  62.             default:
  63.                 break;
  64.         }
  65.     }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement