-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpro2.cc
More file actions
59 lines (57 loc) · 1.72 KB
/
Copy pathpro2.cc
File metadata and controls
59 lines (57 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "Lang_Set.hh"
int main(){
Lang_Set tot;
tot.leer();
string op;
while(cin >> op and op!= "fin"){
if(op=="1"){
//añadir/modificar language
}
else if(op=="2"){
//codificar
}
else if(op=="3"){
//decodificar
}
else if(op=="tabla_frec"){
//consultar freqtb
string aux;
cin >> aux;
cout << "Tabla de frecuencias de " << aux << ":" << endl;
if(tot.is_in_set(aux)){
tot.escribir_frec(aux);
}
else cout << "El idioma no existe" << endl;
}
else if(op=="treecode"){
//consultar treecode
string aux;
cin >> aux;
cout << "Treecode de " << aux << ":" << endl;
if(tot.is_in_set(aux)){
tot.escribir_treecode(aux);
}
else cout << "El idioma no existe" << endl;
}
else if(op=="codigos"){
//consultar codigos
string aux,c;
cin >> aux >> c;
if(c=="todos"){
cout << "Codigos de " << aux << ":" << endl;
if(tot.is_in_set(aux)){
tot.escribir_cod(aux);
}
else cout << "El idioma no existe" << endl;
}
else{
cout << "Codigo de " << c << " en " << aux << ":" << endl;
string n;
if(tot.is_in_lang(aux,c,n)){
cout << c << " " << n << endl;
}
else cout << "El idioma no existe o el caracter no esta en el idioma" << endl;
}
}cout << endl;
}
}