Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.54 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace tsd;
  3.  
  4. class Pessoa{
  5.     string codigo, nome;
  6.     int idade;
  7.     int sexo; //0 mina, 1 man
  8.     double nota;
  9.     public:
  10.         void pb(string& a, string& b, int c, int d, double e){
  11.             codigo = a;
  12.             nome = b;
  13.             idade = c;
  14.             sexo = d;
  15.             nota = e;
  16.         }
  17.         int getSexo(){
  18.             return sexo;
  19.         }
  20.         int getIdade(){
  21.             return idade;
  22.         }
  23.         int getNota(){
  24.             return nota;
  25.         }
  26.  
  27. };
  28.  
  29. class Materia{
  30.     string codigo, nome;
  31.     public:
  32.         void pb(string& a, string& b){
  33.             codigo = a;
  34.             nome = b;
  35.         }
  36.  
  37. };
  38.  
  39. class Mestre{
  40.     vector<Pessoa> pessoas;
  41.     vector<Materia> materias;
  42.     vector<
  43.    
  44.     public:
  45.         void addP(Pessoa& p){
  46.             pessoas.push_back(p);
  47.         }
  48.         void addM(Materia& m){
  49.             materia.push_back(m);
  50.         }
  51. };
  52.  
  53. int main(){
  54.     int t, n;
  55.     scanf("%d", &t);
  56.     n = t;
  57.     Mestre mestre;
  58.     while(t--){
  59.         Pessoa pessoa;
  60.         string codigo, nome;
  61.         int idade;
  62.         int sexo; //0 mina, 1 man
  63.         double nota;
  64.         cin >> codigo >> nome >> idade >> sexo >> nota;
  65.         pessoa.pb(codigo, nome, idade, sexo, nota);
  66.         mestre.addP(pessoa);
  67.     }
  68.     int m;
  69.     scanf("%d", &m);
  70.     while(t--){
  71.         Materia materia;
  72.         string codigo, nome;
  73.         cin >> codigo >> nome;
  74.         materia.pb(codigo, nome);
  75.         mestre.addM(materia);
  76.     }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement