Files
quacker/main.cpp

64 lines
1.0 KiB
C++

#include <iostream>
#include <string>
#include <list>
#include "fecha.hpp"
#include "cuac.hpp"
#include "diccionariocuacs.hpp"
#include "tablahash.hpp"
using namespace std;
DiccionarioCuacs dic = DiccionarioCuacs(20000);
void procesar_pcuac() {
Cuac nuevo;
nuevo.leer_pcuac();
dic.insertar(nuevo);
cout << dic.elem() << " cuac" << endl;
}
void procesar_mcuac() {
Cuac nuevo;
nuevo.leer_mcuac();
dic.insertar(nuevo);
cout << dic.elem() << " cuac" << endl;
}
void procesar_follow() {
string nombre;
cin >> nombre;
dic.follow(nombre); // follow muestra los mensajes del usuario <nombre>
}
void procesar_last() {
int n;
cin >> n;
}
void procesar_date() {
Fecha f1, f2;
f1.leer();
f2.leer();
}
int main() {
int cuacs = 1;
string comando;
while (cin >> comando) {
if (comando == "pcuac") {
procesar_pcuac();
cuacs++;
} else if (comando == "mcuac") {
procesar_mcuac();
cuacs++;
} else if (comando == "follow") {
procesar_follow();
} else if (comando == "exit") {
break;
}
}
return 0;
}