SHARE
TWEET

Untitled

a guest Jan 15th, 2020 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int m[10]={1,2,3,4,5,6,7,8,9,0}, maximo,minimo,i=0;
  6.     int kk[10],pos,j=0;
  7.    
  8. while(i<10)
  9. {
  10.     cout<<"Damelo:"<<endl;
  11.     cin>>m[i];
  12.     i++;
  13. }
  14. i=0;
  15. minimo=m[i];
  16. i++;
  17.  
  18. //cout<<"El mayor es:"<<(maximo)<<endl;
  19. while(i<10)
  20. {
  21.     cout<<"Damelo"<<endl;
  22.     cin>>m[i];
  23.     i++;
  24. }
  25. while(j<10)
  26. {
  27.     i=0;
  28.     maximo=minimo;
  29.     while(i<10)
  30.     {
  31.         if(m[i]>=maximo)
  32.         {
  33.             pos=i;
  34.             maximo=m[i];
  35.         }
  36.         i++;
  37.         }
  38.         m[pos]=-999999;
  39.         kk[j]=maximo;
  40.         j++;
  41. //cout<<"El menor es:<<(minimo)<<endl;
  42.     }
  43.     for(i=0;i<10;i++)
  44.     {
  45.     cout<<"   "<<kk[i];
  46. }
  47. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top