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

Untitled

By: a guest on Apr 29th, 2012  |  syntax: C++  |  size: 1.13 KB  |  hits: 13  |  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. #include <string.h>
  3. #include <stdlib.h>
  4.  
  5.  
  6. using namespace std;
  7.  
  8. const int N = 6;
  9. char simbolo;
  10.  
  11. int Maggiore(int simbolo, int Array[N]);
  12. int Minore(int simbolo, int Array[N]);
  13.  
  14. int main()
  15. {
  16.     int A;
  17.     int Array[N];
  18.     for(int i=0; i<N; i++)
  19.     {
  20.     cout<<"INSERIRE VALORE ARRAY:\n";
  21.     cin>>A;
  22.     Array[i] = A;
  23.     }
  24.     cout<<"Inserisci > per disporre gli elemnti in ordine decrescente oppure < per disporli in ordine crescente:\n";
  25.     cin>>simbolo;
  26.         if(simbolo== '>')
  27.         {
  28.         cout<<Maggiore(simbolo, Array);
  29.         }
  30.         if(simbolo== '<')
  31.         {
  32.         cout<<Minore(simbolo, Array);
  33.         }
  34.          else
  35.         {
  36.     cout<<"il valore inserito e' errato!!\n";
  37.     return 1;
  38.     }
  39.         system("cls");
  40.     return 0;
  41.         system("pausa");
  42. }
  43.  
  44. int Maggiore(int simbolo, int Array [N])
  45. {
  46.     cout<<"gli elementi all'interno dell'array verrano disposti in ordine decrescente\n";
  47.  
  48.  
  49.     return 0;
  50. }
  51.  
  52. int Minore(int simbolo, int Array[N])
  53. {
  54.     cout<<"gli elementi all'interno dell'array verranno disposti in ordine crescente\n";
  55.  
  56.     return 0;
  57. }