Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int main() {
  4. int i, n;
  5. int *pole = NULL;
  6. cout << "Zadaj pocet prvkov pole:";
  7. cin >> n;
  8. pole = new int[n];
  9. cout << "Adresa pola je" << pole << endl;
  10. for (i = 0; i < n; i++) {
  11. pole[i] = rand() % 100;
  12. }
  13. cout << "Generovane cisla su:" << endl;
  14. for (i = 0; i < n; i++) {
  15. cout << "Adresa " << pole + i << " polozka " << pole[i] << endl;
  16. }
  17. delete[]pole;
  18. pole = NULL;
  19. system("pause");
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement