Advertisement
dzieciol

8.2.1

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