Primero que nada, colocamos como comentario en línea para que va a ser utilizado el programa en cuestión, este por lo menos será utilizado para que el numero que le ingreses, lo lea y te muestre en pantalla el resultado multiplicado por 25. Es algo totalmente inútil a menos que necesites sacar algún tipo de cuenta y solo cambies el 25 y coloques el numero que necesites que se multiplique esa cantidad.
Empezamos colocando el primordial #include que sirve para declarar la lectura y escritura.
Luego de eso colocamos “using namespace std;” esto lo colocamos para no tener que escribir “std::cout” en cada línea, si no que solo tendremos que escribir el “cout”
Acá empezamos con lo que vendría siendo el inicio de todo, escribir “int main(){“ indica el punto de partida donde comenzara la magia de programar.
Luego mas abajo, volvemos a colocar otro “int” pero, esta vez con un “n;” este carácter representara el numero que vamos a ingresar nosotros como usuario para que el algoritmo pueda leerlo.
Escribimos lo primero, lo principal “ingrese el numero” va a aparecer escrito en pantalla una vez iniciemos el programa, para terminar cada línea, tenemos que colocar un separador de líneas, y para eso tendremos que escribir “endl;” o “/n” ambos sirven como separadores de línea, sirven para que todo no te quede pegado.
Como escribimos primero en pantalla, ahora leeremos el numero ingresado como respuesta, para ello utilizaremos “cin>>n;” declarando que queremos leer el numero escrito en la ventana.
Mas abajo colocaremos el “cout” y después “Resultado:” para que el numero del resultado se multiplique por 25, tendremos que colocar “25n” seguido de un “endl;” y el comando quedaría mas o menos así “cout<<”Resultado:”<<25n<<endl;”
Para finalizar, escribiremos “return 0;” que sería volver a empezar, ya con el programa terminado, tenemos que probarlo para verificar que funcione.
Como podemos observar, luego de compilarlo y ejecutarlo, nos aparecerá una ventana de Windows, donde lo primero que aparecerá es “Ingrese el numero” al escribir nosotros un número, el que se les ocurra en el momento, este será leído, multiplicado por 25 y se muestra en pantalla nuevamente.
Tal que así, es un programa bastante simple, no lleva mucho tiempo hacerlo, pero, para alguien totalmente nuevo en los algoritmos, esto tiene sus complejidades, ejemplo: Que te pongan a hacer este mismo algoritmo, sin siquiera saber que hacer para que se multiplique por 25. Sería una locura.
Bueno amigos, hasta aquí la publicación de hoy, espero que les haya gustado. Mitsu se despide de ustedes enviándoles un fuerte abrazo.
Hello very good to all friends, today I want to bring you something new, I was late because I was thinking about what to bring and it occurred to me to bring you my algorithm task, I tell you, I am a university student and I am studying computer science, for now it is not so hard, but, later it will become more complex, today I want to bring you the simplest task that I have received of algorithmic, I hope you like it.
First of all, we put as a comment in line what the program in question is going to be used for, it will at least be used to read the number you enter and show you on the screen the result multiplied by 25. It is totally useless unless you need to get some kind of account and just change the 25 and put the number you need to multiply that amount.
We start by placing the primordial "#include" which is used to declare the read and write.
After that we put "using namespace std;" we put this so we don't have to write "std::cout" in each line, but we only have to write the "cout".
Here we start with what would be the beginning of everything, writing "int main(){" indicates the starting point where the magic of programming will begin.
Then further down, we place another "int" but, this time with an "n;" this character will represent the number that we as the user are going to enter so that the algorithm can read it.
We write the first thing, the main thing "enter the number" will appear written on the screen once we start the program, to finish each line, we have to place a line separator, and for that we will have to write "endl;" or "/n" both serve as line separators, they serve so that everything is not stuck together.
As we wrote first on the screen, now we will read the number entered as a response, for this we will use "cin>>n;" declaring that we want to read the number written in the window.
Further down we will place the "cout" and then "Result:" so that the number of the result is multiplied by 25, we will have to place "25n" followed by an "endl;" and the command would look more or less like this "cout<<<"Result:"<<25n<<<endl;"
To finish, we will write "return 0;" which would be to start over, now with the program finished, we have to test it to verify that it works.
As we can see, after compiling and executing it, a Windows window will appear, where the first thing that will appear is "Enter the number" when we write a number, the one that comes to mind at the moment, this will be read, multiplied by 25 and it will be shown on the screen again.
So, it is a fairly simple program, it does not take a lot of time to do it, but, for someone totally new to algorithms, this has its complexities, example: That they put you to do this same algorithm, without even knowing what to do to multiply by 25.
Well friends, so far today's publication, I hope you liked it. Mitsu says goodbye to you sending you a big hug.