Advertisement
dzieciol

8.1.3

Jan 26th, 2015
545
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 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 ilość elementow";
  9.     srand(time(NULL));
  10.     int n;
  11.     cin>>n;
  12.     if (n>0 && n<31){
  13.         cout<<"przetwazanie tablicy"<<endl;
  14.    
  15.     int tab[30];
  16.     for (int i=1;i<=n;i++)
  17.     {
  18.        
  19.         int liczba;
  20.         liczba = rand()%101;
  21.         tab[i] = liczba;
  22.      
  23.         };
  24.       for(int i=1;i<=n;i++)
  25.       cout<<tab[i]<<endl;}
  26.       else
  27.       cout<<"tablica ma niedozwoloną liczbe elementow";
  28.      
  29.      
  30.   system("PAUSE"); 
  31.   return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement