Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: C++  |  size: 0.65 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <iostream>
  2.  
  3.  
  4. using namespace std;
  5.  
  6. cost int N =6;
  7. char simbolo;
  8.  
  9. int Maggiore(simbolo, int Array[N]);
  10. int Minore(simbolo, int Array[N]);
  11.  
  12. int main(){
  13.     int A;
  14.     int Array[N];
  15.     for(int i=0; i<N; i++){
  16.     cout<<"INSERIRE VALORE ARRAY:\n";
  17.     cin>>A;
  18.     Array[i]=A;
  19.     }
  20.     cout<<"Inserisci > per disporre gli elemnti in ordine decrescente oppure < per disporli in ordine crescente:\n";
  21.     cin>>simbolo;
  22.     if(simbolo== '>'|| simbolo== '<'){
  23.         if(simbolo== '>'){
  24.         cout<<Maggiore(simbolo, Array[N]);
  25.         }if(simbolo== '<'){
  26.         cout<<Minore(simbolo, Array[N]);
  27.         }
  28.  
  29.     }
  30.  
  31.     return 0;
  32. }