Cita de: engel lex en 22 Febrero 2018, 14:34 PM
y lo terminaste? XD si para 2009 estaba muy avanzado me imagino que hoy debe estar más aún XD
Lo habia terminado y estaba en sourceforge pero lo abandoné y lo perdí.
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúCita de: engel lex en 22 Febrero 2018, 14:34 PM
y lo terminaste? XD si para 2009 estaba muy avanzado me imagino que hoy debe estar más aún XD
php cliente.phphShell:/> help
      Command             | Description
     ────────────────────────────────────────────────────────────── 
      connect [url]       : Connect to Server WebShell script.
      help                : Show help of the client.
      cat                 : Show the content of remote file.
      tail [file path]    : Read the last lines of specific file.
      cd [directory]      : Navigate to specific remote directory.
      shell [command]     : Execute a simple command in remote server using the           current remote path. Detect automatic available method on the server. See the call-exec command. Alias of exec and system commands.
      force-shell [method] [command] : Force execute a simple command in remote server using an specific php method in current path. Alias of force-exec and force-system commands. Available methods: system, exec, shell_exec, passthru, popen, proc_open, explicit (using double quotes `).
      edit [editor command] [file path] : Edit remote file with specific local command edtor, example: edit vi /etc/shadow
      nano [file path]    : Edit remote file with nano editor on the local system.
      vi [file path]      : Edit remote file with vi editor on the local system.
      vim [file path]     : Edit remote file with vim editor on the local system.
      gedit [file path]   : Edit remote file with gedit editor on the local system.
      notepad [file path] : Edit remote file with notepad editor on the local system.
      sublime [file path] : Edit remote file with sublime text editor on the local system.
      uninstall           : Uninstall the current WebShell on the server.
      install [file path] : Install the WebShell on the specific remote parh.
      mysql [host] [port] [user] [password] : Start an interative MySQL shell connection on the remote server.
      mysqldump [host] [port] [user] [password] [local file] : Make a dump from remote database to local file .sql
      download [remote path] [local path] : Download a backup of file or directory from server to local path.
      upload [local path] [remote path] : Upload a local file or directory to remote directory (maintains the same permits)
      rm [path]           : Delete the specific file or directory path.
      mkdir [path]        : Make a directory on the server.
      phpinfo             : Show the full info of the php, libraries and enviroments of the server.
      id                  : Show the full info of the current user and group on the server.
      ls                  : List files and folders of the current path on the server. Alias of ll and dir commands.
      shellpath           : Show the current local path of the WebShell server.
      pwd                 : Show the current local path on the server.
      uname               : Show the full info of the System Operative of the server.
      exit                : Exit of the client but not remove the WebShell on the server. See uninstall.  Alias of quit command.#include <iostream>
#include <algorithm>
#include <list>
 
using namespace std;
class Alumno
{
    private:
        string nombre;
        int    edad;
        float  promedio;
    public:
        void setNombre(string nombre)
        {
            this->nombre = nombre;
        };
        void setNombre(char nombre[50])
        {
            this->setNombre(string(nombre));
        };
        string getNombre()
        {
            return this->nombre;
        };
        void setEdad(int edad)
        {
            this->edad = edad;
        };
        int getEdad()
        {
            return this->edad;
        };
        void setPromedio(float promedio)
        {
            this->promedio = promedio;
        };
        float getPromedio()
        {
            return this->promedio;
        };
};
class Calculador
{
    private:
        list<Alumno> alumnos;
    public:
        void pedirDatos()
        {
            for(int i = 1; i <= 3; i++)
            {
                Alumno alumno;
                char nombre[50];
                int edad;
                float promedio;
                cout << "Digite nombre del alumno " << i << "   : ";
                cin  >> nombre;
                cout << "Digite edad del alumno " << i << "     : ";
                cin  >> edad;
                cout << "Digite promedio del alumno " << i << " : ";
                cin  >> promedio;
                alumno.setNombre(nombre);
                alumno.setEdad(edad);
                alumno.setPromedio(promedio);
                this->alumnos.push_back(alumno);
            }
        };
        void calcularMejorPromedio()
        {
            std::list<Alumno>::iterator mayor;
            bool first = true;
            
            // Procesa cada alumno
            std::list<Alumno>::iterator alumno = alumnos.begin();
            while (alumno != alumnos.end())
            {
                if(first)
                {
                    first = false;
                    // Primera iteración.
                    mayor = alumno;
                }
                else if(alumno->getPromedio() > mayor->getPromedio())
                {
                    // El promedio del alumno actual es mayor que el
                    // promedio del alumno mayor guardado en memoria.
                    mayor = alumno;
                }
                // Siguiente alumno en la iteracion
                ++alumno;
            }
            // Imprimiendo datos
            cout << endl << "------------------------------------" << endl;
            cout << "El alumno con el mayor promedio es :" << endl;
            cout << "Nombre   : " << mayor->getNombre() << endl;
            cout << "Edad     : " << mayor->getEdad() << endl;
            cout << "Promedio : " << mayor->getPromedio() << endl;
        };
};
int main()
{
    Calculador calculador;
    // system("color 0b");
    calculador.pedirDatos();
    calculador.calcularMejorPromedio();
    // system("pause");
    return 0;
}whk@machine:~/Escritorio$ g++ test.cc -Wall -Wextra -std=gnu++11 -o test
whk@machine:~/Escritorio$ file test
test: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=d0df961dbb63c5df1b4e02ca2430b12c8ecc6646, not stripped
whk@machine:~/Escritorio$ chmod +x test && ./test
Digite nombre del alumno 1   : test1
Digite edad del alumno 1     : 10
Digite promedio del alumno 1 : 5
Digite nombre del alumno 2   : test2
Digite edad del alumno 2     : 11
Digite promedio del alumno 2 : 6
Digite nombre del alumno 3   : test3
Digite edad del alumno 3     : 7
Digite promedio del alumno 3 : 7
------------------------------------
El alumno con el mayor promedio es :
Nombre   : test3
Edad     : 7
Promedio : 7Citar1. f. Dependencia de sustancias o actividades nocivas para la salud o el equilibrio psíquico.
2. f. Afición extrema a alguien o algo.
Citar1. f. Inclinación o atracción que se siente hacia un objeto o una actividad que gustan.
2. f. Conjunto de personas vivamente interesadas por un espectáculo o partidarias de una figura o un grupo que lo protagoniza. La afición colchonera.
3. f. Cariño, afecto o simpatía hacia alguien.
4. f. Actividad que se realiza habitualmente y por gusto en ratos de ocio.
5. f. p. us. Ahínco, empeño.