Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Nombre:
- //TP N°:
- //EJ N°:
- // Comentarios:
- #include <iostream>
- using namespace std;
- int main(void){
- int i,n1,maxn;
- bool ordenado=true;
- cout<< " Ingrese la cantidad de 8 numeros: "<<endl;
- cout<<"--------------------"<<endl;
- for (i = 0; i < 8; i++)
- {
- cin >> n1;
- cout<<"--------------------"<<endl;
- if(i==0)
- {
- maxn=n1;
- }
- else if( n1>=maxn ){
- n1=maxn;
- }
- else if(n1<maxn){
- ordenado=false;
- }
- }
- if(ordenado==false){
- cout<< "Conjunto No Ordenado"<<endl;
- }
- else if(ordenado==true){
- cout<<"--------------------"<<endl;
- cout<< " Conjunto Ordenado "<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment