Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace tsd;
- class Pessoa{
- string codigo, nome;
- int idade;
- int sexo; //0 mina, 1 man
- double nota;
- public:
- void pb(string& a, string& b, int c, int d, double e){
- codigo = a;
- nome = b;
- idade = c;
- sexo = d;
- nota = e;
- }
- int getSexo(){
- return sexo;
- }
- int getIdade(){
- return idade;
- }
- int getNota(){
- return nota;
- }
- };
- class Materia{
- string codigo, nome;
- public:
- void pb(string& a, string& b){
- codigo = a;
- nome = b;
- }
- };
- class Mestre{
- vector<Pessoa> pessoas;
- vector<Materia> materias;
- vector<
- public:
- void addP(Pessoa& p){
- pessoas.push_back(p);
- }
- void addM(Materia& m){
- materia.push_back(m);
- }
- };
- int main(){
- int t, n;
- scanf("%d", &t);
- n = t;
- Mestre mestre;
- while(t--){
- Pessoa pessoa;
- string codigo, nome;
- int idade;
- int sexo; //0 mina, 1 man
- double nota;
- cin >> codigo >> nome >> idade >> sexo >> nota;
- pessoa.pb(codigo, nome, idade, sexo, nota);
- mestre.addP(pessoa);
- }
- int m;
- scanf("%d", &m);
- while(t--){
- Materia materia;
- string codigo, nome;
- cin >> codigo >> nome;
- materia.pb(codigo, nome);
- mestre.addM(materia);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement