Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C++ by Fulleks ( 18 years ago )
#include <cstdlib>
#include <iostream>

using namespace std;

int main()
{
    cout<<\"d&Aring;‚ugo&Aring;›&Auml;‡ ciagu =\";
    int n;
    cin>>n;                         //ustalenie d&Aring;‚ugo&Aring;›cii ciagu 
    int tab[n];                     //definicja dynamiczna tablicy dzia&Aring;‚a tylko w dev C++
    for(int i=0; i<n ; i++)
     cin>>tab[i];                   //wprowadzenie danych
    int y,z;
    z=tab[0];
    y=tab[0];
    for(int i=0; i<n ; i++)         //ustalanie kt&Atilde;&sup3;re jest najmniejsze kt&Atilde;&sup3;re najwieksze
            {
              if (y>tab[i]) y=tab[i];
              if (z<tab[i]) z=tab[i];
            }
     int roznica=z-y;                //odejmowanie
     cout<<roznica;                  //wyprowadzenie daneych 
    system(\"PAUSE\");                 //eleganckie zako&Aring;„czenie porgramu 
    return EXIT_SUCCESS;
}

 

Revise this Paste

Your Name: Code Language: