matogens

zadanie3cpp

May 7th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4.  
  5.  
  6. using namespace std;
  7.  
  8. extern "C" int sumuj(int *tab, int size);
  9.  
  10. int main()
  11. {
  12.     const int ile = 10;
  13.  
  14.     int tab[ile];
  15.     srand(time(NULL));
  16.  
  17.     for(int i = 0; i < ile; i++)
  18.     {
  19.         tab[i] = rand ()%100;
  20.         cout << tab[i] << endl;
  21.     }
  22.  
  23.     cout << sumuj(tab, ile);
  24.  
  25.     return 0;
  26. }
Add Comment
Please, Sign In to add comment