diff --git a/Practica1/main.cpp b/Practica1/main.cpp index 212a66f..c8c5a02 100644 --- a/Practica1/main.cpp +++ b/Practica1/main.cpp @@ -1,16 +1,44 @@ #include #include -#include +#include +#include +#include using namespace std; +char getch(void){ + struct termios oldt, newt; + char ch; + + tcgetattr(STDIN_FILENO, &oldt); + newt = oldt; + newt.c_lflag &= ~(ICANON | ECHO); + tcsetattr(STDIN_FILENO, TCSANOW, &newt); + ch = getchar(); + tcsetattr(STDIN_FILENO, TCSANOW, &oldt); + + return ch; +} + +void clear(){ + ifstream archivo("/etc/os-release"); + + if (archivo.good()) { + system("clear"); + } else { + system("cls"); + } + }; + + + int main() { - char opcion; - while (opcion!=8) - { - cout<