Advertisement
dzieciol

8.2.2

Jan 26th, 2015
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3.  
  4. using namespace std;
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8.     cout<<"podaj wielkość tablicy";
  9.     int n,i;
  10.    
  11.     cin>>n;
  12.     int tab[n];
  13.     cout<<"podaj "<<n<<"elementow tablicy"<<endl;
  14.     for (i=1 ; i<=n ; i++){
  15.     cin>> tab[i];
  16.     cout<<endl;}
  17.     int min;
  18.     min = tab[1];
  19.     for (i=1 ; i<=n ; i++)
  20.     if (min>tab[i])
  21.     min=tab[i];
  22.     cout<<"najmniejszy element to " << min;
  23.    
  24.    
  25.   system("PAUSE");    
  26.   return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement