#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int long num1,num2,num3;
int mayor;
char resp;
string pass;
cout<<" Introduzca el Password:"<<endl;
cout<<"-> ";
cin>>pass;
if(pass=="101110")
{
cout<<"password correcto\n"<<endl;
cout<< "BIENVENIDO"<<endl;
cout<<"\n Este programa le ayudara a encontrar el mayor numero entre una serie."<<endl;
do
{
cout<<"\nIngrese el digito:"<<endl;
cin>>num1;
cout<<"Ingrese el digito:"<<endl;
cin>>num2;
cout<<"Ingrese el digito:"<<endl;
cin>>num3;
if(num1>num2)
{
mayor=num1;
}
if(num2>num1)
{
mayor=num2;
}
if (num3>num2)
{
mayor=num3;
}
cout << "_______________________________________" << endl;
cout << "Desea agregar mas numeros? (s/n):" << endl;
cout<<"-> ";
cin >> resp;
}
while (resp=='s');
}
else
{
cout<<"La clave es invalida, el programa se da por terminado"<<endl;
}
cout<<"\nEl mayor es "<<mayor<<" !\n"<<endl;
cout<<"\n\n................gracias por usar el programa................"<<endl;
cout<<"\n _______________"<<endl;
cout<<" |Autor: CamiloCV|"<<endl;
cout<<"\ |_______________|\n"<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.